AGL2 documentation

Adaptive Graph Library

See:
          Description

Packages
agl2 Adaptive Graph Library
agl2.alg Adaptive Graph Library algorithms
agl2.rep  
agl2.util  

 

Adaptive Graph Library

Example

Here is simple way to build a graph.
    public static void main(String[] args) {
        GraphBuilder gb;
        String a,b,c,d,e;
        Object va,vb,vc,vd,ve;

        gb = new DigraphBuilder();
        va = gb.addVertex (a = new String ("a"));
        vb = gb.addVertex (b = new String ("b"));
        vc = gb.addVertex (c = new String ("c"));
        vd = gb.addVertex (d = new String ("d"));
        ve = gb.addVertex (e = new String ("e"));

        gb.addEdge (va,vb, null);
        gb.addEdge (va,vd, null);
        gb.addEdge (vb,vc, null);
        gb.addEdge (vc,vd, null);
        gb.addEdge (vc,ve, null);
        gb.addEdge (vd,va, null);
        gb.addEdge (ve,va, null);

        Digraph g = gb.getDigraph();
        System.out.println (g.toString());
    }
    

Concepts

Representations

Representations manipulate edges and vertices. These provide fundamental ways of representing graph structures. In addition, each representation also exports vertex and edge type and set of tags and natural maps.

Properties

Each graph type supports certain properties. A graph may be undirected or support multiple edges between a pair of nodes. Each property of the graph is tagged. Representations also provide properties to a graph. Many property maps are predefined by the representations. For example, EDGE_DATA in Matrix Rep will provide a map like interface to edge data stored in the matrix. While for other representations will be simply implemented as a HashMap of Edge to Object.

Graphs

Each graph is made up of a Representation and a set of tags/properties . Graphs provide an abstraction layer that hide Representation and defines allowed operations (in terms of properties). Algorithms work directly on graphs.

Builders

Builders construct graphs. They are also responsible for choosing the best representation of a graph based on a set of request properties. Each builder maintains a representation and and a set of properties.

Algorithms

Algoirthms will operate on different types of graphs. Suggest/Require graph tags for efficient run. Decorate graph with extra tags.

Listeners

Listeners are used during graph building events. Example : VERTEX_DATA property maintenence is done through a graph listeners.

Internally these are used to maintain the maps. Users may create and add their own listeners.