Title: Alan M. Frisch
1Constraint Technology for the Masses
- Alan M. Frisch
- Artificial Intelligence Group
- Department of Computer Science
- University of York
- Collaborators
- Ian Miguel, Toby Walsh, Pierre Flener,
Brahim Hnich, Zeynep Kiziltan, Justin Pearson
2Constraint Programming is Important
- Useful for solving a wide range of problems
including scheduling, allocation, layout. - Often used on large, complex problems whose
solution is crucial. - Constraint technology is a big business.
- Powerful toolkits are available
- Eclipse from IC PARC
- Solver from ILOG
3Formulation Bottleneck
- Use of current technology requires modelling a
problem as a constraint program. - This requires moderate/great expertise.
- Hence constraint technology is used almost
exclusively by large enterprises on problems with
large payoff.
4Reducing the Formulation Bottleneck
- Systematise the knowledge of the expert.
- The expert can recognise patterns in problems and
match them to patterns of problem formulations. - The expert can choose among alternatives.
5Exploiting Common Patterns
- Published in journals with analyses of
properties. - Catalogued in textbooks with guidance on
selection. - Implemented in libraries.
- Supported by high-level languages.
- Exploited by intelligent compilers.
This would bring constraint technology to BScs.
6Making Constraint Technology Invisible
- Conceal constraint technology behind intuitive
user interfaces. - Pre-programmed patterns would be provided.
This would bring constraint technology
to the masses.
7The Constraint Satisfaction Problem
- An instance of the CSP consists of
- Finite set of variables X1,,Xn, having finite
domains D1,,Dn. - Finite set of constraints. Each restricts the
values that the variables can simultaneously
take. Example x neq y. xyltz.
8Solutions of a CSP Instance
- A total instantiation maps each variable to an
element in its domain. - A solution to a CSP instance is a total
instantiation that satisfies all the constraints. - Problem Given an instance
- Determine if it is satisfiable (has a solution)
- Find a solution
- Find all solutions
- Find optimal solution
9Partial Instantiation Search
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
1
0
1
0
1
1
0
0
1
1
0
1
0
0
0
0
1
0
0
1
0
1
0
0
1
0
0
0
0
1
1
0
0
0
1
1
0
1
1
0
1
1
1
0
1
0
1
X
X
!
X
!
!
1
0
0
1
0
1
1
0
0
1
0
1
0
0
0
0
1
0
1
1
0
1
0
X
!
!
!
10Matrix Models
- A problem formulation involving one or more
(multi-dimensional) matrices of decision
variables. - Often has row and column symmetry.
Round Robin Tournament Schedule
11Matrix Models are Prevalent
- Commonly used to implement sets, subsets,
partitions, relations, functions, permutations - Of 31 problems in CSPlib (www.csplib.org), 27
have natural matrix models, most already
published and arguably the most natural models. - Many have row and column symmetries.
12Overview
- I Systematic refinement of high-level
- specifications to matrix models.
- II Breaking row and column symmetry.
- III Vision of constraint spreadsheets.
13 Part ISystematic refinement of high-level
specificationsto matrix models.
14Balanced Academic Curriculum Problem
- Assign courses to periods in which they will be
taught such that - Course load in each period is not too large or
too small. - Credit load in each period is not too large or
too small. - The prerequisites to each course are taught
before the course.
15High-level Specification
- Find a function CUR courses ? periods
- Constraints are inequalities involving CUR,
CUR-1, cardinality and summation. - We have semi-systematically transformed this to a
variety of alternative matrix models. Major
decisions - How to represent CUR.
- The introduction of a 1D matrix of variables to
store the credit load of each period (from
CGRASS).
161D Matrix Representation of a Function
CUR1
Periods
Periods
Periods
Periods
Periods
Periods
No straightforward way to express the credit
load of a period with facilities of current
constraint programming languages.
Courses
172D Matrix Representation of a Function
?1 ?1
All constraints can be expressed as linear
inequalities.
181D 2D Matrix Representation of a Function
CUR1
Periods
Periods
Periods
Periods
Periods
Periods
All constraints can be expressed
straightforwardly.
CUR2c,p 1 ? CUR1c p
19Golumb Ruler Problem
- We have systematically transformed a high-level
specification of the problem into an efficient
CSP formulation (roughly that of Smith, Stergiou
Walsh). This involves - Introducing new variables.
- Replacing constraints with more powerful ones.
- Refinement choosing subset to choosing values.
- Breaking symmetry.
- Reasoning about ordered subscripts.
20CGRASS
- A system that automatically generates implied
constraints and symmetry breaking constraints to
improve efficiency of solver. - Currently operates on problem instances, but is
now being extended to handle problem classes. - Major lesson inferences must be made at the
appropriate level of abstraction. Refinement
rules as well as inference rules are needed.
21Part IIBreaking Row and Column Symmetries
22Index Symmetry in One Dimension
A B C
D E F
G H I
- 2 Dimensions
- A B C ? lex D E F ? lex G H I
- Can be extended to n dimensions and partial
symmetry.
23Index Symmetry in Multiple Dimensions
A B C
D E F
G H I
A B C
D E F
G H I
Consistent
Consistent
A B C
D E F
G H I
A B C
D E F
G H I
Inconsistent
Inconsistent
24Incompleteness of Double Lex
1
0
1
0
1
0
Swap 2 columns Swap row 1 and 3
0
1
0
1
0
1
25Enforcing Lexicographic Ordering
- We have developed a linear time algorithm for
enforcing generalized arc-consistency on a
lexicographic ordering constraint between two
vectors of variables. - Experiments show that in some cases it is vastly
superior to previous consistency algorithms, both
in time and in amount pruned.
26Part III Constraint Spreadsheets
- Matrix of decision variables can be viewed and
manipulated through a spreadsheet-style
interface. - Simple methods for imposing constraints on
multiple rows/columns w/out iteration or
recursion. - Facilitate mixed-initiative solving and what-if
reasoning. - Endow spreadsheets with solving in addition to
calculation. - Object-oriented hierarchy of style sheets for
solving common problem types.
27Conclusion
- Constraint technology has made impressive
progress, yet available toolkits support
constraint programming at only a low level of
abstraction. - First steps to bring technology to the masses
- Develop high-level language supported with
automatic refinement and reformulation,
especially to matrix models. - Efficient methods for solving matrix models,
especially for breaking index symmetry. - Constraint spreadsheets.