Interface HamiltonianPathAlgorithm


public interface HamiltonianPathAlgorithm
A Hamiltonian path is a path that contains all vertices of the graph.
Author:
Cristian Frăsinaru
See Also:
  • Method Details

    • findPath

      Path findPath()
      Returns:
      a Hamiltonian path, or null if the graph does not contain one or the algorithm is unable to find it.
    • findPath

      Path findPath(int source, int target)
      Parameters:
      source - the first vertex number of the path.
      target - the last vertex number of the path.
      Returns:
      a Hamiltonian path starting in source and ending in path, or null if the graph does not contain one or the algorithm is unable to find it.
    • getInstance

      static HamiltonianPathAlgorithm getInstance(Graph graph)
      Parameters:
      graph - the input graph.
      Returns:
      the default implementation of the algorithm.