Introduction

1 Introduction

The Java Graph Library (JAGAL) is a Java library for modelling directed graphs. It comes with implementations of various types of graphs and transition systems, as well as utilities for their modification and traversal.

Its key features include among others:

  • Implementation of directed graphs
  • Implementation of directed weighted graphs
  • Graph algorithms (Tarjan for SCCs)
  • Graph visualization (Circle layout, topological layout)
  • Graph traversal (depth-first-search, breadth-first-search)
  • Traversal utilities (Predecessors, Siblings, Cycles, . . . )
  • Implementation of Transition Systems
  • Implementation of Labelled Transition Systems

This document is a mix of a programming tutorial and a library documentation, where the features get demonstrated with some visualisations and minimal programming code examples.

The examples in this document have been tested against the JAGAL release version 1.0.0, which can be found at https://github.com/iig-uni-freiburg/JAGAL. This document was last updated on July 29, 2015.

1.1 Library Dependencies

JAGAL builds upon the Java library TOVAL, which is a set of Java classes for common programming issues. It is located under https://github.com/GerdHolz/TOVAL and must be added to the class path to be able to use JAGAL.

For the visualization of graphs, JAGAL uses the JGraphX library, which is a Java Swing diagramming library specialized on node-edge graphs. JGraphX can be downloaded under https://github.com/jgraph/jgraphx.

1.2 Package Structure

The packages in de.uni.freiburg.iig.telematik.jagal are logically divided into the following sub-packages. Methods of data structure defining classes like graphs and tran- sition systems are always defined in abstract classes with generics to keep constraints between data types and to allow users to easily define their own sub-classes. Through using generics, the types of the vertices and edges can be set as needed. Their concrete subclasses like Graph or TransitionSystem only contain their constructors and need only to specify the vertex data type over generics. This way, clarity in the data structure and an intuitive depth of inheritance is ensured.

  • The package graph contains all classes which are needed to define a graph structure. Weighted graphs can be found in the sub-package weighted.
  • The traverse package contains both classes and interfaces for traversals through data structures and algorithms using traversal classes.
  • Classes in the package visualization can be used to visualize graph structures. For each structure, a corresponding component class is defined.
  • Transition systems are defined in the package ts. For labelled transition systems there is another sub-package named labeled. Two more packages contain classes for serializing and parsing transition systems.