Graph Constraints

The following constraint can be thought of as constraining n nodes in a graph to form a Hamiltonian circuit. The nodes are numbered from 1 to n. The circuit starts in node 1, visits each node, and returns to the origin.

circuit(+Succ, +Pred)

where Succ is a list of length n of domain variables. The i:th element of Succ (Pred) is the successor (predecessor) of i in the graph. True if the values form a Hamiltonian circuit.

Corresponds to circuit/1 in MiniZinc.

Send feedback on this subject.