Class SimplePathsEnumeratorAbstract

java.lang.Object
com.jgalgo.alg.shortestpath.SimplePathsEnumeratorAbstract
All Implemented Interfaces:
SimplePathsEnumerator
Direct Known Subclasses:
SimplePathsEnumeratorSedgewick

public abstract class SimplePathsEnumeratorAbstract extends Object implements SimplePathsEnumerator
Abstract class for enumerating all simple paths between a source and target vertices.

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

    • SimplePathsEnumeratorAbstract

      public SimplePathsEnumeratorAbstract()
      Default constructor.
  • Method Details

    • simplePathsIter

      public <V, E> Iterator<Path<V,E>> simplePathsIter(Graph<V,E> g, V source, V target)
      Description copied from interface: SimplePathsEnumerator
      Iterate over all the simple paths between a source and a target vertices in the given graph.

      If g is an IntGraph, an iterator of IPath objects will be returned.

      Specified by:
      simplePathsIter in interface SimplePathsEnumerator
      Type Parameters:
      V - the vertices type
      E - the edges type
      Parameters:
      g - a graph
      source - the source vertex
      target - the target vertex
      Returns:
      an iterator that iteration over all simple paths between the two vertices in the graph