[ library(cycle) | Reference Manual | Alphabetic Index ]

cycle(+Edges, ++EdgeWeights, -CycleCost)

A constraint that forces a Hamiltonian cycle in a directed graph
A list of ic variables
A square matrix of integers
The cost of the cycle


	Edges is a list of length VertexCount of ic variables, where VertexCount is the number of 
	vertices in the graph. Each variable needs to have a domain which is the subset of 
	[1..VertexCount]. The values in the i-th variable's domain correspond to edges in the 
	graph, so the domain value j of the i-th variable corresponds to an edge (i,j). 

	EdgeWeights is a square matrix (array of arrays) of size VertexCount*VertexCount of nonnegative 
	integers. The value indexed [i,j] corresponds to the cost of the edge (i,j). Values on the diagonal
	([i,i]) are unimportant since the correspond to edges (i,i) which are automatically removed by
	the constraint.

	CycleCost is an ic variable that corresponds to the cost of the cycle. 

	This version of the constraint uses the maximal propagation level. For more details and 
	configuration of different propagation levels see cycle/4. 

Modes and Determinism

Fail Conditions

It is impossible to find any Hamiltonian cycle in the graph


(1) general error
Wrong edge weigh matrix size.
(1) general error
Wrong edge list length.
(6) out of range
Wrong edge domain values.
(1) general error
Wrong weight value.
(8) bad argument list
Unknown options

See Also

cycle / 4