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

letting dNum be domain int(1..n)

$ find sets (cardinality is enforced by size)
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
,
    $ constraints from problem
    (sum i in setA . i) = (sum i in setB . i)
,
    (sum i in setA . i*i) = (sum i in setB . i*i)