Class CyclesEnumeratorAbstract

java.lang.Object
com.jgalgo.alg.cycle.CyclesEnumeratorAbstract
All Implemented Interfaces:
CyclesEnumerator
Direct Known Subclasses:
CyclesEnumeratorJohnson, CyclesEnumeratorTarjan

public abstract class CyclesEnumeratorAbstract extends Object implements CyclesEnumerator
Abstract class for enumerating all simple cycles in a graph.

The class implements the interface by solving the problem on the index graph and then maps the results back to the original graph. The implementation for index graphs is abstract and left to the subclasses.

Author:
Barak Ugav
  • Constructor Details

    • CyclesEnumeratorAbstract

      public CyclesEnumeratorAbstract()
      Default constructor.
  • Method Details

    • cyclesIter

      public <V, E> Iterator<Path<V,E>> cyclesIter(Graph<V,E> g)
      Description copied from interface: CyclesEnumerator
      Iterate over all cycles in the given graph.

      If g is IntGraph, the returned iterator will iterate over IPath objects.

      Specified by:
      cyclesIter in interface CyclesEnumerator
      Type Parameters:
      V - the vertices type
      E - the edges type
      Parameters:
      g - a graph
      Returns:
      an iterator that iteration over all cycles in the graph