net.innig.collect
Class Graphs

java.lang.Object
  extended by net.innig.collect.Graphs

public abstract class Graphs
extends java.lang.Object

Graph utilities.

Maturity: This is obviously a very immature API. The implementation of the single method in it, however, works quite well.
Plans: In the future, innig-util will include more complete graph handling utilities.

Version:
[Development version]
Author:
Paul Cantrell

Method Summary
static
<N> java.util.Set<java.util.List<N>>
findCycles(N initial, GraphWalker<N> walker)
           
static
<N> java.util.Set<N>
reachableNodes(N initial, GraphWalker<N> walker)
          Returns the set of all nodes reachable along directed paths from a given node in a given graph.
static
<N> java.util.Set<N>
reachableNodesFromSet(java.util.Set<N> initial, GraphWalker<N> walker)
          Returns the set of all nodes reachable along directed paths from a given set of nodes in a given graph.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

reachableNodes

public static <N> java.util.Set<N> reachableNodes(N initial,
                                                  GraphWalker<N> walker)
Returns the set of all nodes reachable along directed paths from a given node in a given graph. The implementation is smart about cycle detection.


reachableNodesFromSet

public static <N> java.util.Set<N> reachableNodesFromSet(java.util.Set<N> initial,
                                                         GraphWalker<N> walker)
Returns the set of all nodes reachable along directed paths from a given set of nodes in a given graph. The implementation is smart about cycle detection.


findCycles

public static <N> java.util.Set<java.util.List<N>> findCycles(N initial,
                                                              GraphWalker<N> walker)