annas.graph.util
Class CycleDetector<N,A extends ArcInterface<N>>

java.lang.Object
  extended by annas.graph.util.CycleDetector<N,A>
Type Parameters:
N - Node type
A - Arc type

public class CycleDetector<N,A extends ArcInterface<N>>
extends java.lang.Object

Detects cycles in a graph, this classes uses a depth first search to discover cycles.

Author:
Sam Wilson

Constructor Summary
CycleDetector(GraphInterface<N,A> graph)
           
 
Method Summary
 boolean containsCycle()
          Executes the algorithm
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CycleDetector

public CycleDetector(GraphInterface<N,A> graph)
Method Detail

containsCycle

public boolean containsCycle()
Executes the algorithm

Returns:
true if the algorithm discovers a cycles