Package org.graph4j.hamiltonian
package org.graph4j.hamiltonian
-
ClassDescriptionBacktracking algorithm for determining the longest path in a graph (directed or not).A Hamiltonian (or spanning) cycle is a cycle that contains all vertices of the graph.A Hamiltonian path is a path that contains all vertices of the graph.The algorithm finds a Hamiltonian cycle in an undirected simple graph that satisfies Ore's condition:
deg(v) + deg(u) >= |V(G)|, for every pair of distinct non-adjacent vertices v and u.