Package com.aoindustries.util.graph
Class SymmetricAcyclicGraphChecker<V,EX extends Exception>
- java.lang.Object
-
- com.aoindustries.util.graph.SymmetricAcyclicGraphChecker<V,EX>
-
- All Implemented Interfaces:
GraphChecker<EX>
public class SymmetricAcyclicGraphChecker<V,EX extends Exception> extends Object implements GraphChecker<EX>
A symmetric directed acyclic graph checker.- Author:
- AO Industries, Inc.
-
-
Constructor Summary
Constructors Constructor Description SymmetricAcyclicGraphChecker(SymmetricMultiGraph<V,?,? extends EX> graph, boolean isForward)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckGraph()Test the graph for cycles and makes sure that all connections are consistent with back connections.
-
-
-
Constructor Detail
-
SymmetricAcyclicGraphChecker
public SymmetricAcyclicGraphChecker(SymmetricMultiGraph<V,?,? extends EX> graph, boolean isForward)
-
-
Method Detail
-
checkGraph
public void checkGraph() throws AsymmetricException, CycleException, EX extends ExceptionTest the graph for cycles and makes sure that all connections are consistent with back connections. Cycle algorithm adapted from: http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/depthSearch.htm http://www.eecs.berkeley.edu/~kamil/teaching/sp03/041403.pdf In the case of a multigraph, any number of edges one direction is considered a match to any number of edges back. The number does not need to be equal.- Specified by:
checkGraphin interfaceGraphChecker<V>- Throws:
AsymmetricException- where the edges are not symmetricCycleException- if there is a cycle in the graphEX extends Exception
-
-