Classes and interfaces for traversing graphs.

Package Specification

Graphs and their traversals have the following components:

Queues are described in the com.ibm.jcs.analysis.util.queue package. The other objects and interfaces are described below. The traversals show how the pieces are connected.

Nodes
Nodes are rather generic. Nodes may define functions for obtaining predecessor and successor nodes and predecessor (inward adjacency) and successor (outward adjacency) edges. While all nodes implement JCSNode, all nodes may not implement all of the other interfaces.
Edges
Edges contain a from node and a to node. Some edge implementations may contain other information specific to the implementation.
Iterators
Unlike the Iterators found in the java.util package these Iterators are really iterator generators that act as predicates that can filter or add new nodes/edges as is appropriate for a particular problem. The simplest iterators just return predecessor/successor nodes/edges. More sophisticated iterators perform complex computations to determine which set of nodes/edges to return.

Depending on the type of graph, the iterator may be very simple (e.g., for CGCallSites), or more complex (object references and basic blocks).

Visitors
For each specialized sort of analysis, there will be a custom visitor, though there are some simple reusable examples.
Traversals
These classes demonstrate a number of commonly used graph traversal algorithms. They also provide design patterns on how the node, queue, iterator, and visitor classes interact with one another.