| A GPL Package
A Graph Product Line (GPL) package is a customized set of graph algorithms written in the Java language. This particular package implements a , graph with the following algorithms:
Click on the above algorithm names for more detail about them and how to invoke them. This document also contains sections on the following topics:
Programmatic Invocation Algorithm Descriptions Implementation Notes
Programmatic Invocation
The following code snippet illustrates how a graph object is defined. First a Graph object is created. Then each vertex is created, and then each edge is added with its corresponding weight. Note in the code below that edge information has already been created in a set of arrays (startVertices, endVertices, weights); you can substitute your own code for this. Similarly, Vertex objects need not have manufactured names.
Graph g = new Graph(); Vertex V[] = new Vertex[num_vertices]; for ( i=0; i!=m_vertices; i++ ) aaV[i] = new Vertex().assignName(v + i); for ( i=0; i!=num_edges; i++ ) { Vertex v1 = ( Vertex ) V[ startVertices[ i ] ]; Vertex v2 = ( Vertex ) V[ endVertices[ i ] ]; EdgeIfc edge = g.addEdge( v1, v2 ); edge.setWeight( weights[ i ] ); }
Once a graph object is created, you can invoke a graph algorithm. Let algName be the name of an algorithm (look below to find the exact name and parameter list). A typical invocation looks like:
g.algName();
Algorithm Descriptions
Let G denote a Graph object and V denote a Vertex object.
Implementation Notes

Copyright AHEAD / Onekin Research Group. All rights reserved.
Revised: March 17th, 2006

Report questions/problems: Don Batory | Salva Trujillo