dm87-lec3-2x2.pdf

Outline
DM87
SCHEDULING,
TIMETABLING AND ROUTING
1. Resume
Lecture 3
2. Modeling: Mixed Integer Formulations
Mathematical Programming Formulations,
Constraint Programming
3. Special Purpose Algorithms
4. Constraint Programming
Marco Chiarandini
DM87 – Scheduling, Timetabling and Routing
Outline
2
Linear, integer, nonlinear programming, optimization
program = optimization problem
min f (x)
gi (x) = 0, i = 1, 2, . . . , k
hj (x) ≤ 0, j = 1, 2, . . . , m
x ∈ Rn
1. Resume
2. Modeling: Mixed Integer Formulations
general (nonlinear) program (NLP)
3. Special Purpose Algorithms
min cT x
Ax = a
Bx ≤ b
x≥0
(x ∈ Rn )
4. Constraint Programming
linear program (LP)
DM87 – Scheduling, Timetabling and Routing
3
DM87 – Scheduling, Timetabling and Routing
min cT x
Ax = a
Bx ≤ b
x≥0
(x ∈ Zn )
(x ∈ {0, 1}n )
(linear) integer program (IP, MIP)
4
Algorithms for Integer Programming
Algorithms for Integer Programs
special ,,hard” combinatorial optimization problems
special ,,simple” combinatorial optimization problems Finding a:
I
minimum spanning tree
I
shortest path
I
maximum matching
I
maximal flow through a network
I
cost-minimal flow
...
solvable in polynomial time by special purpose algorithms
I
DM87 – Scheduling, Timetabling and Routing
I
traveling salesman problem
I
location and routing
I
set-packing, -partitioning, -covering
I
max-cut
I
linear ordering
I
scheduling (with a few exceptions)
I
node and edge colouring
I
...
NP-hard (in the sense of complexity theory)
The most successful solution techniques employ linear programming.
5
DM87 – Scheduling, Timetabling and Routing
Algorithms for Integer Programs
6
Outline
1. Resume
I
1) Branch & Bound
I
2) Cutting Planes
2. Modeling: Mixed Integer Formulations
Branch & cut,
Branch & Price (column generation),
Branch & Cut & Price
3. Special Purpose Algorithms
4. Constraint Programming
DM87 – Scheduling, Timetabling and Routing
7
DM87 – Scheduling, Timetabling and Routing
8
Modeling: Mixed Integer Formulations
I
Transportation Problem
I
Weighted Bipartite Matching Problem
Set Partitioning
Set Covering
min
n
P
j=1
n
P
j=1
min
cj xj
aij xj ≥ 1
∀i
n
P
j=1
n
P
j=1
cj x j
Set Packing
max
aij xj = 1 ∀i
xj ∈ {0, 1}
xj ∈ {0, 1}
Traveling Salesman Problem
DM87 – Scheduling, Timetabling and Routing
n
P
j=1
n
P
j=1
cj x j
aij xj ≤ 1
∀i
xj ∈ {0, 1}
9
Traveling Salesman Problem
DM87 – Scheduling, Timetabling and Routing
DM87 – Scheduling, Timetabling and Routing
10
Traveling Salesman Problem
10
DM87 – Scheduling, Timetabling and Routing
10
Traveling Salesman Problem
DM87 – Scheduling, Timetabling and Routing
Traveling Salesman Problem
10
Traveling Salesman Problem
DM87 – Scheduling, Timetabling and Routing
DM87 – Scheduling, Timetabling and Routing
10
Traveling Salesman Problem
10
DM87 – Scheduling, Timetabling and Routing
10
24,978 Cities
24,978 Cities
solved by LK-heuristic
and prooved optimal
by branch and cut
solved by LK-heuristic
and prooved optimal
by branch and cut
10 months of
computation on a
cluster of 96 dual
processor Intel Xeon
2.8 GHz workstations
10 months of
computation on a
cluster of 96 dual
processor Intel Xeon
2.8 GHz workstations
http://www.tsp.
gatech.edu
http://www.tsp.
gatech.edu
Summary
I
Outline
1. Resume
We can solve today explicit LPs with
I
I
up to 500,000 of variables and
up to 5,000,000 of constraints routinely
2. Modeling: Mixed Integer Formulations
in relatively short running times.
I
We can solve today structured implicit LPs (employing column
generation and cutting plane techniques) in special cases with hundreds
of million (and more) variables and almost infinitely many constraints in
acceptable running times. (Examples: TSP, bus circulation in Berlin)
DM87 – Scheduling, Timetabling and Routing
12
3. Special Purpose Algorithms
4. Constraint Programming
DM87 – Scheduling, Timetabling and Routing
13
Special Purpose Algorithms
Special Purpose Algorithms
Branch and Bound
divide and conquer + lower bounding technique
Dynamic programming
procedure based on divide and conquer
Based on principle of optimality the completion of an optimal sequence of
decisions must be optimal
I
Break down the problem in stages at which the decisions take place
I
Find a recurrence relation that takes us backward (forward) from one
stage to the previous (next)
In scheduling, this can be typically done only for objectives that are sequence
independent (eg, the makespan).
DM87 – Scheduling, Timetabling and Routing
14
DM87 – Scheduling, Timetabling and Routing
Outline
15
Constraint Satisfaction Problem
I
1. Resume
Input: a set of variables X1 , X2 , . . . , Xn and a set of constraints. Each
variable has a non-empty domain Di of possible values. Each constraint
Ci involves some subset of the variables and specify the allowed
combination of values for that subset.
[A constraint C on variables Xi and Xj , C(Xi , Xj ), defines the subset
of the Cartesian product of variable domains Di Dj of the consistent
assignments of values to variables. A constraint C on variables Xi , Xj is
satisfied by a pair of values vi , vj if (vi , vj ) ∈ C(Xi , Xj ).]
2. Modeling: Mixed Integer Formulations
3. Special Purpose Algorithms
I
4. Constraint Programming
Task: find an assignment of values to all the variables
{Xi = vi , Xj = vj , . . .} such that it is consistent, that is, it does not
violate any constraints
If assignments are not all equally good, but some are preferable this is
reflected in an objective function.
DM87 – Scheduling, Timetabling and Routing
16
DM87 – Scheduling, Timetabling and Routing
17
Search Problem
I
Types of Variables and Values
initial state: the empty assignment {} in which all variables are
unassigned
I
successor function: a value can be assigned to any unassigned variable,
provided that it does not conflict with previously assigned variables
I
goal test: the current assignment is complete
I
path cost: a constant cost
I
Discrete variables with finite domain:
complete enumeration is O(dn )
I
Discrete variables with infinite domains:
Impossible by complete enumeration.
Instead a constraint language (and constraint logic programming and
constraint reasoning)
Eg, project planning.
Sj + pj ≤ Sk
Two search paradigms:
I
search tree of depth n
I
complete state formulation: local search
DM87 – Scheduling, Timetabling and Routing
NB: if linear constraints, then integer linear programming
I
18
variables with continuous domains
NB: if linear constraints or convex functions then mathematical
programming
DM87 – Scheduling, Timetabling and Routing
Types of constraints
19
General purpose solution algorithms
Search algorithms
I
Unary constraint
I
Binary constraints (constraint graph)
I
Higher order (constraint hypergraph)
Eg, Alldiff()
tree with branching factor at the top level nd
at the next level (n − 1)d.
The tree has n! · dn even if only dn possible complete assignments.
Every higher order constraint can be reconduced to binary
(you may need auxiliary constraints)
I
Preference constraints
cost on individual variable assignments
I
CSP is commutative in the order of application of any given set of
action. (the order of the assignment does not influence)
I
Hence we can consider search algs that generate successors by
considering possible assignments for only a single variable at each node
in the search tree.
Backtracking search
depth first search that chooses one variable at a time and backtracks when a
variable has no legal values left to assign.
DM87 – Scheduling, Timetabling and Routing
21
DM87 – Scheduling, Timetabling and Routing
22
Backtrack Search
DM87 – Scheduling, Timetabling and Routing
Backtrack Search
23
General Purpose backtracking methods
1) Which variable should we assign next, and in what order should its
values be tried?
2) What are the implications of the current variable assignments for the
other unassigned variables?
3) When a path fails – that is, a state is reached in which a variable has no
legal values can the search avoid repeating this failure in subsequent
paths?
DM87 – Scheduling, Timetabling and Routing
25
I
No need to copy solutions all the times but rather extensions and undo
extensions
I
Since CSP is standard then the alg is also standard and can use general
purpose algorithms for initial state, successor function and goal test.
I
Backtracking is uninformed and complete. Other search algorithms may
use information in form of heuristics
DM87 – Scheduling, Timetabling and Routing
24