Bounds Consistency
x A primitive constraint c is bounds consistent with domain D if for each variable x in
vars(c)
x There exist real numbers d1, ., dk for remaining vars x1, ., xk such that for
each xi, min(D,xi) di max(D,xi) and
cfw_ x min(D,x), x1 d1,
Cumulative Example
Bernd is moving house again. He has 4 friends to help and must move in one hour.
He has the following furniture
Item
Time to move
No. of people needed
piano
30 min
3
chair
10 min
1
bed
15 min
3
table
15 min
2
Constraint Logic Programs (
Constraint Satisfaction Problems
x A constraint satisfaction problem (CSP) consists of:
x A conjunction of primitive constraints C over variables X1,., Xn
x A domain D which maps each variable Xi to a set of possible values
D(Xi)
x It is understood as the
Achieving Arc Consistency
x arc_consistent_primitive(c, D)
if |vars(c)| = 2 then
let cfw_x,y = vars(c)
D(x) := cfw_ d D(x) | exists e D(y)
cfw_x d, y e is a solution of c
return D
x Removes values which are not arc consistent with c
x arc_consistent(C,D)
Evaluating CLP Programs
x A CLP program is evaluated by running a goal which is a sequence of literals (I.e.
user defined constraints and primitive constraints).
x The leftmost user-defined constraint is repeatedly replaced by its definition until no
user
Requirements on Modelling
x Logical Specification
x All tasks assigned a resource
x High-Level Constraints
x At least two days off in any consecutive ten days
x User-definable constraints
x Each overseas task requires a full-skills team
x Each solution mu
Real Problems
x Wrong solutions
x Problem formalisation
x Software reports no solution
x Problem formalisation
x No solutions found
x Algorithm
Wrong Solutions
x Implicit Constraints
Cant unload where cars are parked
x Data errors
If we dont know the weig
TunnelBuilder-Pro (Cisco)
x Fast Rerouter
x Problem Solver
x Linear relaxation
x Interleaved search
x Constraints
x Maximum flows
x Shared Risk Groups
x Status
x Cisco Product
SERVAIR CREW (French Railways)
x Crew rostering system
x assign service staff t
Simple Backtracking Solver
back_solve(C,D)
if vars(C) is empty return partial_satisfiable(C)
choose x in vars(C)
for each value d in D(x)
let C1 be C with x replaced by d
if partial_satisfiable(C1) then
if back_solve(C1,D) then return true
return false
Co
Problem model
Our Algorithm
x (1) Find an alternative route for each flow
x (2) Find an edge E supporting several alternative routes,
that cant, in the worst case, support them all.
If there arent any, we are done!
x (3) Choose a flow that must not use ed