Class HamiltonianPathDemo

java.lang.Object
org.jgrapht.demo.HamiltonianPathDemo

public final class HamiltonianPathDemo extends Object
Hamiltonian path demos for both directed and undirected graphs.

Hamiltonian path existence is NP-complete in general. The algorithms shown here are exact exponential-time solvers and are intended for relatively small graphs. For large graphs no polynomial-time algorithm is known.

The demo prints the path (a vertex sequence and its weight) when one exists, and a message otherwise.

Author:
seilat
  • Method Details

    • main

      public static void main(String[] args)