In the mathematical field of graph theory the Hamiltonian path problem and the Hamiltonian cycle problem are problems of determining whether a Hamiltonian path (a path in an undirected or directed that visits each vertex exactly once) or a Hamiltonian cycle exists in a given graph (directed or undirected);
The minimum flow cost hamiltonian cycle https://ideone.com/zLI66K