Title: Combining Models and Algorithms
1Combining Models and Algorithms
- - from Alchemy to Cookery
2Divide and Conquer
- Decompose Problem
- Devise Solver for each Subproblem
- Combine Solvers
3Architecture
PhD
Solver Platform
4Overview
- Two Example Problems
- Steps from Conceptual Model to Design Model
- Schemas for Subproblem Interaction
- Transformations
- Design Model Requirements
5Construction Scheduling
6Construction Scheduling with Maintenance
Constraints
- No resource is used more than a fixed time limit
without maintenance - No more than a fixed number of resources are in
maintenance at the same time
7Construction Scheduling Complexity Results
- Resource problem Polynomial
- (maximum flow of minimum cost)
- Resource problem with maintenance NP-hard
- (multiprocessor scheduling problem)
8Construction Scheduling
- Decomposition
- assign resources to tasks
- schedule resource maintenance
- Hybridisation
- pass maintenance intervals to (B)
- report success or failure to (A)
- (A) after failure, extend duration of each task
by one maintenance interval
9Logistics with Depots
10Logistics with Depots
- Collection and delivery time windows
- Vehicle capacity data
- Travel time data
- Vehicle load/unload time data
- Driver shift data
- Minimise cost
11Logistics with Depots
- Decomposition
- (A) consignment routing
- (B) load consolidation
- vehicle routing
- inter-depot consolidation
- vehicle assignment
- driver allocation
- Hybridisation
- route for consignment - to (B)
- consolidate with other consignments, cost - to
(A) - (A) choose cheapest alternative - to (B)
- (B) optimise consolidation for all consignments
12Overview
- Two Example Problems
- Steps from Conceptual Model to Design Model
- Schemas for Subproblem Interaction
- Transformations
- Design Model Requirements
13Steps to Design Model
- Decompose
- Transform
- Add Inference
- Specify Search
- Specify Subproblem Interaction
14A Toy Example
problem1 - c1(X,Y), c2(Y,Z), c3(Z,X), c4(X,U,
V).
c2
Y
Z
c1
c3
X
U
V
c4
15Toy Example Decomposition
sub_p
problem - sub_p(X), sub_q(X). sub_p(X)
- c1(X,Y), c2(Y,Z), c3(Z,X). sub_q(X)
- c4(X,U,V).
c2
Y
Z
c1
c3
X
U
V
c4
sub_q
16Toy Example Transformation
sub_p
problem - sub_p(X), sub_q(X). sub_p(X)
- c1(X,Y), c2(Y,Z), c3(Z,X). sub_q(X)
- c5(T,X), c6(T,U), c7(T,V).
c2
Y
Z
c1
c3
X
c5
T
c6
c7
U
V
sub_q
17Toy Example Inference
problem - sub_p(X), sub_q(X). sub_p(X) -
X,Y,Z1..10, infer( c1(X,Y) ,fc) , infer(
c2(Y,Z) ,fc) , infer( c3(Z,X) ,fc) . sub_q(X)
- X,U,V1..10, infer( c5(T,X) ,fc) ,
infer( c6(T,U) ,ac) , infer( c7(T,V) ,ac) .
sub_p
c2fc
Y
Z
c1fc
c3fc
X
c5fc
T
c6ac
c7ac
U
V
sub_q
18Toy Example Search
problem - sub_p(X),sub_q(X). sub_p(X) -
X,Y,Z1..10, infer( c1(X,Y) ,fc) , infer(
c2(Y,Z) ,fc) , infer( c3(Z,X) ,fc), label(X),
check(Y) . sub_q(X) - X,U,V1..10, infer(
c5(T,X) ,fc) , infer( c6(T,U) ,ac) , infer(
c7(T,V) ,ac) .
19Steps to Design ModelConstruction Scheduling
- Decompose
- Assign resources to tasks
- Schedule resource maintenance
- Transform
- Introduce assignment booleans
- Add Inference
- Optimise linear relaxation
- FD propagation
- Specify Search
- MIP
- Partially order maintenance tasks
20Steps to Design ModelLogistics with Depots
- Decompose
- Consignment routing
- Load consolidation
-
- Transform
- Introduce minimisation of routes per collection
point -
- Add Inference
-
- Interval consistency
- Specify Search
-
- BB interleaved with consignment routing final
BB
21Overview
- Two Example Problems
- Steps from Conceptual Model to Design Model
- Schemas for Subproblem Interaction
- Transformations
- Design Model Requirements
22Subproblem Interaction Direct
Subproblems solved concurrently
23Subproblem Interaction Via Search Agent
sub_p
Search agent alternates with subproblem solvers
global search agent
sub_q
24Subproblem Interaction Via Intermediates
Constraint store is blackboard forsubproblem
solvers
sub_p
global search agent
sub_q
constraint store
sub_r
25Subproblem Composition
problem
26Subproblem Interaction What is Communicated?
- Perfect Relaxation
- Via Search Agent
- Via Intermediates
- Direct
27Perfect Relaxation - A Toy Example
W
c3
c2
problem1 - c1(X,Y), c2(Y,W), c3(W,Z), c4(Z,X)
, c5(X,U,V).
Z
Y
c4
c1
X
U
V
c5
Naïve worst-case complexity o(d6)
28Perfect Relaxation No Subproblem Interaction!
problem1 - sub_1(X), sub_4(X). sub_1(X)
- sub_2(X,W), sub_3(W,X). sub_2(X,W)
- c1(X,Y),c2(Y,W). sub_3(W,X) - c3(W,Z),
c4(Z,X). sub_4(X) - c5(X,U,V).
Naïve worst-case complexity o(d3)
29Subproblem Interaction What is Communicated?
- Perfect Relaxation
- set of solutions
- Via Search Agent
- Via Intermediates
- Direct
30Reporting Success or Failure
sub_p
search agent
assignment
sub_q
NB Search method influences communication
31Reporting Cost
sub_p
search agent
assignment
sub_q
32Returning Value Choice Heuristics
sub_p
Example Limited Discrepancy Search
search agent
assignment
sub_q
33Returning Variable Choice Heuristics
sub_p
search agent
assignment
Tree Search
sub_q
34Variable Choice Heuristics Updating the
Meta-Data
sub_p
assignment
result
search agent
Constraint Names Scopes
result
sub_q
assignment
35Subproblem Interaction What is Communicated?
- Perfect Relaxation
- set of solutions
- Via Search Agent
- assignment/result/constraint scopes
- Via Intermediates
- Direct
36Info Communicated with Intermediates
sub_p
search agent
sub_q
constraint store
sub_r
NB Search method influences communication
37Info Communicated with Intermediate Repair
Search
38Info Communicated with Intermediate
Incremental Search
sub_p
fd
search agent
finite domains
assignment
fd
39Info Communicated with FD Intermediate
sub_p MAC
fd
search agent
finite domains
assignment
fd
40Deleteff
sub_p
search agent
finite domains
sub_q
sub_r
constraint graph
41Search by Adding Constraints
sub_p
search agent
finite domains
sub_q
constraint
sub_r
constraint graph
newsub
42Propagation by Adding Constraints
sub_p
search agent
finite domains
sub_q
sub_r
constraint graph
43Info Communicated with Linear Intermediate
44Info Communicated with Linear Intermediate
linear constraint solver
linear constraint
sub_p
assignment
45Combining Solvers - Probing
sub_p
alternative constraints
variablelabels
conflicts
searchagent
assignment
linearconstraintsolver
sub_q
linear constraint
46Combining Solvers FD and Linear
sub_p
finite domains
search agent
sub_q
sub_r
47Subproblem Interaction What is Communicated?
- Perfect Relaxation
- set of solutions
- Via Search Agent
- assignment/result/constraint scopes
- Via Intermediates
- assignment/result/ constraint scopes/
- constraints/conflict
- Direct
48Communicating Infeasible Assignments
Relaxed Problem
Full Problem
assignment
success/failure
Solve relaxed problem
Extend relaxed solution to a solution to the
full problem
49Communicating Infeasible Assignments -
Construction Scheduling
assign resources to tasks
schedule resource maintenance
assignment
success/failure
On failure, add one maintenance periodto each
task, and solve again
50Communicating Infeasible Assignments -
Construction Scheduling
create fdconstraints
assignment
finite domains
sub_p
sub_q
sub_r
linear constraint solver
search agent
createlinearconstraints
failure
51Communicating Infeasible Assignments
Relaxed Problem
Full Problem
assignment
constraint
Search for a solution
Find violated constraints
Constraint always holds for the full problem
52Communicating Infeasible Assignments Via an
Intermediate
search agent
assignment
sub_p
constraint store
constraint
Constraint posted at root of search tree
53Communicating Infeasible Assignments Via a
Linear Solver
sub_q
linear constraint solver
linear constraints
sub_r
search agent
assignment
variable labels
54Communicating Tentative Assignments
Partial Problem
Full Problem
assignment
constraint
Generate a solution
Use assignment as a search heuristic
Constraint only holds below current node in
search tree
55Communicating Tentative Assignments - Probing
assignmentconflicts
variablelabels
sub_q
constraints
sub_p
finite domains
searchagent
linearconstraintsolver
constraints
56Communicating Assignments and Costs
sub_p
sub_q
assignment
cost
Search for a feasible assignment
Evaluate cost
Local or Constructive Search
57Logistics with Depots
consignmentrouting
loadconsolidation
assignment
cost
Propose assignment
Evaluate cost
58Logistics with Depots
tentative label
search consignmentrouting
variablelabels
search loadconsolidation
cost
finitedomains
chosen label
59Local Search Under Constraints
Sub Problem
Full Problem
assignment
cost
Find a feasible neighbour
Calculate its cost bound
Skeleton and Flesh
60Local Search Under Constraints Workforce
Scheduling
createMIPconstraints
sub_p
assignment
search engineersrouting
linearconstraints
search allocate tasks to engineers
cost
variablelabels
61Lagrangian Relaxation
Main Problem With Soft Constraints
Sub Soft Constraints
assignment
cost function
Evaluate violations of soft constraints
Search for a solution
Aim Find cost function such that optimal
solution of relaxed problem is optimal solution
of full problem
62Lagrangian Relaxation Interdependence of
Subproblems
- Aim only possible if Main problem has necessary
properties - Termination of iteration requires further
properties of Main - Sub only makes sense for solving Main
- Sub cannot be tackled independently of Main
63Lagrangian Relaxation
assignment
Remainder Of Problem
64Lagrangian Relaxation
lagrangian relaxation
hard constraints
linear constraints
soft constraints
assignment
Remainder Of Problem
For cookery treat as one solver
65Column Generation
Slave Problem
Master Problem
assignment
cost
Use assignment to improve previous solutions
Search for solutions under cost constraint
Done when no admissible solutions can be found
66Column Generation Interdependence of Subproblems
- Decomposition only makes sense for column
generation - Master problem solution is a linear combination
of slave problem solutions - Slave problem can be handled independently of
master
67Column Generation Construction Scheduling
find optimal combination for all resources
find sequence of activities for a resource
68Column Generation
linear constraints
master constraints
sub_p
dual costs
new columns
column generator
cost
slave constraints
slave problem
assignment
Still Alchemy!
69Subproblem Interaction What is Communicated?
- Perfect Relaxation
- set of solutions
- Via Search Agent
- assignment/result/constraint scopes
- Via Intermediates
- assignment/result/ constraint scopes/
- constraints/conflict
- Direct
- assignment/result/ constraint scopes/
- constraints/conflict
- transformed assignments/constraints
70Overview
- Two Example Problems
- Steps from Conceptual Model to Design Model
- Schemas for subproblem interaction
- Transformations
- Design Model Requirements
71Steps to Design Model
- Decompose
- Transform
- Infer
- Search
72Transformations
- N-ary to Binary
- CSP -gt MIP
- CSP Dual
- Linear Dual
73Decomposition and Transformation
sub_q
sub_p
Transformation
t_sub_p
???
74N-ary to Binary
sub_n
Variables remain Constraints changed New
variables added
N-ary to binary
Alchemy New constraints and new variables
exported
sub_2
Cookery Only old variables exported
75CSP to MIP
- Numeric variables remain
- Constraints reified
- Boolean variables added
- Symbolic values mapped to numeric
csp_p
CSP to MIP
Alchemy New constraints, new variables, and new
values exported
mip_p
Cookery Only old variables exported. New numeric
values automatically mapped to symbolic
76CSP Dual
sub
Variables changed Constraints changed
CSP Dual
Alchemy New constraints and new variables
exported
dual_sub
Cookery Exported information automatically
undualised!
77Linear Dual
sub
This dual is usually hidden Within the linear
solver.
Alchemy Export Shadow Prices And Reduced Costs
Linear Dual
dual_sub
Cookery Hide dual info. inside specialised agents
78Overview
- Two Example Problems
- Steps from Conceptual Model to Design Model
- Schemas for Subproblem Interaction
- Transformations
- Design Model Requirements
79Design Model Requirements
- Represent problem decomposition
- Map problem model to subproblem models
- Represent subproblem solvers
- Map conceptual model to algorithm
- Capture solver combination
- Map algorithms to hybrid algorithm
80Research into Design Model
- Start bottom up
- Routing
- Partitioning
- Scheduling
- Collect and analyse algorithms
- Constraint propagation
- Linear constraint solving
- Complete search
- Stochastic search
- Devise (modelling) languages
- For expressing algorithms
- For combining algorithms
81CSP and Constraint Programming -Language Aims
- Teaching MBAs
- Familiar
- Simple
- Closed
- Developing Advanced Algorithms
- Powerful
- Integrated
- Reconfigurable
82IC-Parc Research Aims the ECLiPSe Language
- Separate modelling from behaviour
- Support an extensive toolset
- Representations
- Algorithms
- Support experimentation
- Representations
- Algorithms
- Hybrids
83IC-Parc and Parc Technologies - Applications
- Transportation
- Internet Support
- Logistics