# Constraint Programming in Scheduling Professor Edward Tsang University of Essex

```Constraint Programming in
Scheduling
Professor Edward Tsang
University of Essex
URL: http://cswww.essex.ac.uk/CSP/
1
Tuesday, 31 May 2016
Car Sequencing Problem
Options
ABS
CD
…


Production:
30




30
40
Total:
120
CD area:  2/3
ABS area:  3/5
20


2
Tuesday, 31 May 2016
What is Constraint Satisfaction?
• Constraint satisfaction is a decision problem
– You are given a number of decisions to make
– For each decision, you are given all the choices
– Decisions constrain each other
violating any of the constraints
• Sometimes you want the “best” solution
– If so, you have a (constrained) optimisation problem
7
Tuesday, 31 May 2016
Why constraint satisfaction?
• It is a very general problem (seen everywhere)
– Mainly logistics, scheduling, resources allocation
• Specialized methods available
• Scientific challenges:
– Combinatorial explosion (fundamental problem)
– Modelling (engineering problem)
8
Tuesday, 31 May 2016
Combinatorial Explosion
of the Car Sequencing Problem
• Schedule 30 cars:
– Search space: 30 factorial  1032 leaf nodes
• Generously allow:
– Explore one in every 1010 leaf nodes!
– Examine 1010 nodes per second!
• Problem takes over 32 thousand years to solve!!!
– 1032 &divide; 1010 &divide; 1010 &divide; 60 &divide; 60 &divide; 24 &divide; 365  31,710
• How to contain combinatorial explosion?
9
Tuesday, 31 May 2016
Constraint Programming
Given:
Problem
Description
Formulations
(Modelling)
Algorithms
Implementations
(e.g. ILOG Solver)
• Areas: modelling, algorithms, algorithm mapping,
monitoring, packages
10
Tuesday, 31 May 2016
Constraint Techniques Overview
1. Problem Reduction
– To reduce domain size
constraints
– Aims:
• To reduce a problem
to easier ones
2. Search
• Systematic Search
– Learning nogoods or backtrack
Aim: to exhaustively search space
• Stochastic methods
– To repair solutions heuristically
Aim: to find solutions fast,
sacrificing completeness
3. (Solution Synthesis)
11
Tuesday, 31 May 2016
Backtracking Search In The 8-Queens Problem
Complete search, till solution found, or “no solution” is concluded
A B C D E F G H
• Place one queen
per row
Strategies
• Placeatone
queen
• Learning “no goods”
at
a
time
• dependency directed
backtracking
• Examine each
column
1
2
3
4
X
5
6
7
8
12
Tuesday, 31 May 2016
Forward Checking Search
• Problem reduction
– a major technique
• Combined with
search methods
• Reduce domain of
future variables
– To backtrack early
4 – no legal space for row 6,
backtrack…
A B
C
D E
F
G H
1
2 X X
3 X X X X
4 X
X X
5 X X X
X X
X X X
6 X X X X X X X X
X X
X
7 X X X
X X
X
8 X X X
13
Tuesday, 31 May 2016
The GLS Algorithm
• Iterative local search
• In a local minimum
– Select Features
Ii(s*) = 1 if s*
exhibits feature
i; 0 otherwise
ci = cost of
feature i
c
i
I ( s*) 
i
1 p
i
• Maximize utility
– Increase penalties (strengthen constraints)
• Resume Local Search from Local
15
pi = penalty
Minimum
of feature I
(init. to 0)
Tuesday, 31 May 2016
Population-based Incremental Learning
(PBIL)
Model M:
x = v1 (0.5)
x = v2 (0.5)
y = v3 (0.5)
y = v4 (0.5)
…..
Sample from M
solution X, eg
&lt;x,v1&gt;&lt;y,v4&gt;
Evaluation X
Modify the probabilities
• Statistical approach
• Related to ant-colonies, GA
16
Tuesday, 31 May 2016
Scheduling in Grid Computing
Issues
scheduling
• To minimize job span,
cost
• Execution time unknown
• M/c may breakdown
• Domains negotiate
• Security