Download
language Essence 1.3
$ Problem Number Partition
$
$ Problem details available at http://www.csplib.org/Problems/prob049/
$
$ Essence model by Andrew Martin
$
$ Licenced under CC-BY-4.0 : http://creativecommons.org/licenses/by/4.0/
given n : int(1..)
where n%2 = 0
given P : int(0..)
letting dNum be domain int(1..n)
$ find sets
find setA: set (size n/2) of dNum
find setB: set (size n/2) of dNum
such that
$ setlist must include all elements in dNum
|setA union setB| = n
,
$ cannot share any elements
|setA intersect setB| = 0
,
forAll power : int(0..P) .
(sum i in setA . i**power) = (sum i in setB . i**power)