Class SymmetricAcyclicGraphChecker<V,Ex extends Exception>

Type Parameters:
Ex - An arbitrary exception type that may be thrown
All Implemented Interfaces:

public class SymmetricAcyclicGraphChecker<V,Ex extends Exception> extends Object implements GraphChecker<Ex>
A symmetric directed acyclic graph checker.
AO Industries, Inc.
  • Constructor Details

    • SymmetricAcyclicGraphChecker

      public SymmetricAcyclicGraphChecker(SymmetricMultiGraph<V,?,? extends Ex> graph, boolean isForward)
  • Method Details

    • checkGraph

      public void checkGraph() throws AsymmetricException, CycleException, Ex
      Test the graph for cycles and makes sure that all connections are consistent with back connections.

      Cycle algorithm adapted from:

      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:
      checkGraph in interface GraphChecker<V>
      AsymmetricException - where the edges are not symmetric
      CycleException - if there is a cycle in the graph