But Shaun’s already proved P equals NP. Can’t we move onto quantified SAT? Woof!
Set Variables using as an example Steiner Triples
Set Variables using as an example Steiner Triples SteinerKirkman
… and BIBD’s, 0/1 encoding, symmetry breaking See choco manual 1.4.2, page 14 and 15 CSPLib prob028 choco manual 6.3, pages 64 and 65 choco manual 8.56 lex (constraint)
Represented with two bounds kernel: intersection of all possible sets envelope: the union of all possible setsupper bound lower bound
We will do this by example, solving a problem
We are given a set S of size n. Produce n.(n-1)/6 triples (subsets of S of size 3) such that given any pair of triples their intersection is of size at most 1 Equivalently, every possible pair of elements in S occurs in only one of the n.(n-1)/6 triples
Given a set of size n, how many triples are we to produce? Equivalently, every possible pair of elements in S occurs in only one of the triples How many pairs are there? n.(n-1)/2 Every triple contains 3 pairs Therefore n.(n-1)/6 triples required
We are given a set S of size n. Produce n.(n-1)/6 triples (subsets of S of size 3) such that given any pair of triples their intersection is of size at most 1
A triple is also called a “block” and the entries of a block a “point” This is then a BIBD (balanced incomplete block design) Applications: design of experiments, testing, …
Modelling the Steiner Triple problem using Set Variables
Given a set of size n, how many triples are we to produce? Equivalently, every possible pair of elements in S occurs in only one of the triples How many pairs are there? n.(n-1)/2 Every triple contains 3 pairs Therefore n.(n-1)/6 triples required
Compile and Run
An alternative representation
0/1 Array m=7 block point Sum of a column = 3, intersection between two columns is at most
Compile & Run For both models try n=1, n=7, n=9 Show effect of symmetry breaking and search over only decision variable
How about we do the following: Generate all triples where 0 ≤ i < j < k < m and pick the ones we want Have a zero/one IntegerVariable for each triple, in an array A, such that A[i][j][k] is 1 iff we select triple Flatten the array A into a one-D vector, say v? Constrain v such that it sums to m.(m-1)/6 For every pair of triples that match on two indices make the sum of their corresponding constrained integer variables be at most 1 (i.e. select at most 1 of these triples) Is this dumb?
Fix i and j: Sum of A[i][j][*] ≤ 1 Fix i and k: Sum of A[i][*][k] ≤ 1 Fix j and k: Sum of A[*][j][k] ≤ 1 But we need to ensure that the sum of the above sums is also at most 1 For every pair of triples that match on two indices make the sum of their corresponding constrained integer variables be at most 1 (i.e. select at most 1 of these triples)
The age of stupid
Compile & Run
An array, m by m, where pair[i][j] is an integer pair[i][j] = k means that pair (i,j) is in kth block Proposed by Chris Unsworth Location, location, location pair[i][j] = k iff points i and j are in block[k] The number of points in a block is 3
Proposed by Chris Unsworth Location, location, location Constrain pair[i][j] = k iff block[k][i] = 1 and b[k][j] = 1 i and j are in the kth triple if and only if kth triple contains i and kth triple contains j
Compile & Run
More generally Steiner Triple is a BIBD
So? 1. Set variables 2. Steiner triples 3. Various models (four!) 4. Symmetry breaking with lex 5. Dare to be stupid