case study 5: balanced academic curriculum problem

73
Case study 5: Case study 5: balanced balanced academic academic curriculum curriculum problem problem Joint work with Brahim Hnich and Joint work with Brahim Hnich and Zeynep Kiziltan (CPAIOR 2002) Zeynep Kiziltan (CPAIOR 2002)

Upload: ariel-tucker

Post on 04-Jan-2016

38 views

Category:

Documents


0 download

DESCRIPTION

Case study 5: balanced academic curriculum problem. Joint work with Brahim Hnich and Zeynep Kiziltan (CPAIOR 2002). Outline. Introduction Balanced Academic Curriculum Problem (BACP) Alternate Models Combined Models Experimental Results Conclusions. Introduction. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Case study 5: balanced academic curriculum problem

Case study 5: Case study 5: balanced balanced academic academic

curriculum curriculum problem problem Joint work with Brahim Hnich and Joint work with Brahim Hnich and

Zeynep Kiziltan (CPAIOR 2002)Zeynep Kiziltan (CPAIOR 2002)

Page 2: Case study 5: balanced academic curriculum problem

OutlineOutline

IntroductionIntroduction Balanced Academic Curriculum Balanced Academic Curriculum

Problem (BACP)Problem (BACP) Alternate ModelsAlternate Models Combined ModelsCombined Models Experimental ResultsExperimental Results ConclusionsConclusions

Page 3: Case study 5: balanced academic curriculum problem

IntroductionIntroduction

Modelling optimisation problems as CSPs Modelling optimisation problems as CSPs requires many skillsrequires many skills

Quite often alternate models are triedQuite often alternate models are tried models that add implied constraintsmodels that add implied constraints models that add symmetry-breaking constraintsmodels that add symmetry-breaking constraints models that use different variable representationmodels that use different variable representation models that use different constraint formulationmodels that use different constraint formulation combined modelscombined models

solved with the same solution methodsolved with the same solution method solved with different solution methodssolved with different solution methods

Page 4: Case study 5: balanced academic curriculum problem

RecipeRecipe

Create a basic modelCreate a basic model Decide on the variablesDecide on the variables

Introduce auxiliary Introduce auxiliary variablesvariables For messy/loose For messy/loose

constraintsconstraints Consider dual, combined Consider dual, combined

or 0/1 modelsor 0/1 models Break symmetryBreak symmetry Add implied constraintsAdd implied constraints Customize solverCustomize solver

Variable, value orderingVariable, value ordering

Page 5: Case study 5: balanced academic curriculum problem

BACP: descriptionBACP: description

12

1 2 3 4

34

5678

Periods

Courses

Each course has associated a Each course has associated a numbernumber of creditsof credits

some courses can have other some courses can have other courses as prerequisitecourses as prerequisite

a minimum amount of credits a minimum amount of credits per period is requiredper period is required

a maximum amount of a maximum amount of credits per period is allowedcredits per period is allowed

a minimum number of a minimum number of courses per period is courses per period is requiredrequired

a maximum number of a maximum number of courses per period is allowedcourses per period is allowed

Page 6: Case study 5: balanced academic curriculum problem

BACP: objectiveBACP: objective

Assign a period to every course such that the Assign a period to every course such that the

following constraints are satisfied:following constraints are satisfied: the minimum and maximum academic load for the minimum and maximum academic load for

each period each period the minimum and maximum number of courses for the minimum and maximum number of courses for

each periodeach period the prerequisite relationshipsthe prerequisite relationships

An optimal balanced curriculum minimises An optimal balanced curriculum minimises

the maximum academic load for all periodsthe maximum academic load for all periods

Page 7: Case study 5: balanced academic curriculum problem

Model 1: variablesModel 1: variables

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

Courses

PeriodsCur1

Page 8: Case study 5: balanced academic curriculum problem

Model 1: constraintsModel 1: constraints

Each course is taughtEach course is taught jperiods Cur1[i,j] = 1

Min and max courses per periodMin and max courses per periodc icourses Cur1[i,j] d

Page 9: Case study 5: balanced academic curriculum problem

Model 1: constraintsModel 1: constraints Each course is taughtEach course is taught

jperiods Cur1[i,j] = 1

Min and max courses per periodMin and max courses per periodc icourses Cur1[i,j] d

Academic load in each period more messyAcademic load in each period more messy Each course comes with a weightEach course comes with a weight Is there a way of dealing with this constraint Is there a way of dealing with this constraint

efficiently?efficiently?

Page 10: Case study 5: balanced academic curriculum problem

RecipeRecipe

Create a basic modelCreate a basic model Decide on the variablesDecide on the variables

Introduce auxiliary variablesIntroduce auxiliary variables For messy/loose constraintsFor messy/loose constraints

Consider dual, combined or Consider dual, combined or 0/1 models0/1 models

Break symmetryBreak symmetry Add implied constraintsAdd implied constraints Customize solverCustomize solver

Variable, value orderingVariable, value ordering

Page 11: Case study 5: balanced academic curriculum problem

Refine Model 1: auxiliary Refine Model 1: auxiliary varsvars

Add auxiliary variables to compute Add auxiliary variables to compute academic load in each periodacademic load in each period

Load(j) = icourses credit(i)*Cur1[i,j]

Page 12: Case study 5: balanced academic curriculum problem

Model 1: variablesModel 1: variables

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

0..1 0..1 0..1 0..1

Courses

Periods

=1

=1

.

.

.

.

.

Cur1

0..maxint 0..maxint 0..maxint 0..maxint

Load Periods

Page 13: Case study 5: balanced academic curriculum problem

Load(j) = icourses credit(i)*Cur1[i,j]

c icourses Cur1[i,j] d

a Load(j) b

Computing load of period j:

Restricting the load of period j:

Restricting the number of courses of period j:

Objective function:

minimize max(Load)

Prerequisite constraints btw i and j:

kperiods: k> 1 Cur1[j,k] r=1 Cur1[i,r]k-1

Model 1: constraints Model 1: constraints Good NewsGood News::

all constraints are linear: all constraints are linear: we can also employ ILP we can also employ ILP methodsmethods

Bad NewsBad News:: prerequisite constraints:prerequisite constraints:

too many constraintstoo many constraints high arity-constraintshigh arity-constraints

We refer to model 1 as We refer to model 1 as CP1CP1 when CP solver is when CP solver is used andused and ILP ILP when ILP when ILP solver is usedsolver is used

Page 14: Case study 5: balanced academic curriculum problem

Breaking symmetryBreaking symmetry

Shouldn’t we be worrying about Shouldn’t we be worrying about breaking symmetry?breaking symmetry?

Page 15: Case study 5: balanced academic curriculum problem

Breaking symmetryBreaking symmetry

Shouldn’t we be worrying about Shouldn’t we be worrying about breaking symmetry?breaking symmetry? Not reallyNot really Time periods are not usually Time periods are not usually

symmetrical due to pre-requisitessymmetrical due to pre-requisites Similarly courses are only symmetrical Similarly courses are only symmetrical

if they carry the same load and pre-if they carry the same load and pre-requisites requisites

Page 16: Case study 5: balanced academic curriculum problem

Alternative models?Alternative models?

Model 1 has lots of 0/1 variablesModel 1 has lots of 0/1 variables Can’t we exploit larger domains that Can’t we exploit larger domains that

CSPs give us?CSPs give us?

Page 17: Case study 5: balanced academic curriculum problem

Model 2: variablesModel 2: variables

in periods in periods in periods in periodsin periods

courses

0..maxint 0..maxint 0..maxint 0..maxint

Load Periods

Cur2

Page 18: Case study 5: balanced academic curriculum problem

Model 2: constraintsModel 2: constraints

Load(j) = icourses credit(i)*B i,j

atleast(j, Cur2,c) atmost(j,Cur2,d)

a Load(j) b

Computing load of period j:

Restricting the load of period j:

Restricting the number of courses of period j:

Objective function:

minimize max(Load)

Prerequisite constraint btw i and j:

Cur2[i] < Cur2[j]

Good NewsGood News:: use of global constraintsuse of global constraints efficient statement of efficient statement of

prerequisite constraintsprerequisite constraints Bad NewsBad News::

load computation:load computation: more Boolean variablesmore Boolean variables more reification more reification

constraintsconstraints

We refer to model 2 as We refer to model 2 as CP2CP2

B i,j Cur2[i]=j, for all i

Page 19: Case study 5: balanced academic curriculum problem

Model Model CP1CP1 vs. Model vs. Model CP2CP2

CP2Good News:

use of global constraints to restriction number of coursesstatement of prerequisite constraints

Bad News:statement of academic load constraint

CP1Good News:

academic load constraint easily stated by a weighted column sum

Bad News:statement of prerequisite constraints

Page 20: Case study 5: balanced academic curriculum problem

Combined model Combined model CP1CP1++CP2CP2

CP2Good News:

use of global constraints to restriction number of coursesstatement of prerequisite constraints

Bad News:statement of academic load constraint

CP1Good News:

academic load constraint easily stated by a weighted column sum

Bad News:statement of prerequisite constraints

Cur1[i,j]=1 Cur2[i]=j

- Channelling constraintsBad News

- Increased number of variables

Page 21: Case study 5: balanced academic curriculum problem

Model Model ILPILP vs Model vs Model CP2CP2

CP2Good News:

use of global constraints to restriction number of coursesstatement of prerequisite constraints

Bad News:statement of academic load constraint

ILPGood News:

academic load constraint easily stated by a weighted column sumall constraints are linear

Bad News:statement of prerequisite constraints

Page 22: Case study 5: balanced academic curriculum problem

Hybrid model Hybrid model ILPILP++CP2CP2

CP2Good News:

statement of prerequisite constraints

ILPGood News:

academic load constraint easily stated by a weighted column sumall constraints are linear

Bad News:statement of prerequisite constraints

Cur1[i,j]=1 Cur2[i]=j

- Channelling constraintsBad News

- Increased number of variables

Page 23: Case study 5: balanced academic curriculum problem

Finding optimal solutionFinding optimal solution We used three real-life instancesWe used three real-life instances CP1CP1++CP2CP2 is the is the quickestquickest

due to the increase in the amount of pruning that due to the increase in the amount of pruning that compensated the increase in variables and constraintscompensated the increase in variables and constraints

ILPILP++CP2CP2 is is second bestsecond best model model better than better than CP2CP2 in all instance in all instance better than better than ILPILP in two instances in two instances CP model is essential in reducing the search space CP model is essential in reducing the search space

while the ILP model with its relaxation is essential for while the ILP model with its relaxation is essential for bounding and guiding the searchbounding and guiding the search

Page 24: Case study 5: balanced academic curriculum problem

Proving optimalityProving optimality Proving OptimalityProving Optimality

ILPILP++CP2CP2 is quicker than is quicker than ILPILP on two instances, on two instances,

and is the and is the quickestquickest on these instances on these instances

ILPILP++CP2CP2 benefits from CP model in reducing benefits from CP model in reducing

the search space, and from the relaxation of the search space, and from the relaxation of

the ILP modelthe ILP model

It is tough for all CP models (It is tough for all CP models (CP1CP1, , CP2CP2, ,

CP1CP1++CP2CP2) to prove optimality) to prove optimality

Page 25: Case study 5: balanced academic curriculum problem

Yet other alternate Yet other alternate modelsmodels

Viewing BACP as a set partitioning Viewing BACP as a set partitioning problemproblem the set of courses ought to be partitioned into the set of courses ought to be partitioned into

n subsets, one for each periodsn subsets, one for each periods n set variables that are subsets of the set of coursesn set variables that are subsets of the set of courses the union of all set variables is the set of coursesthe union of all set variables is the set of courses all set variables must be pair-wise disjointall set variables must be pair-wise disjoint all constraints of BACP can easily be stated using all constraints of BACP can easily be stated using

weighted cardinality, and cardinality constraintsweighted cardinality, and cardinality constraints except, the prerequisite constraints!except, the prerequisite constraints!

To enhance the model based on set variables, To enhance the model based on set variables,

we can also channel into the model we can also channel into the model CP2CP2

Page 26: Case study 5: balanced academic curriculum problem

ConclusionsConclusions

Lesson 1Lesson 1: When constraints are difficult to specify : When constraints are difficult to specify

in a particular model, we should consider in a particular model, we should consider

channelling into a second model in which these channelling into a second model in which these

constraints are easier to specify and reason aboutconstraints are easier to specify and reason about

Lesson 2Lesson 2: :

CP models may excel in finding optimal or near-optimal CP models may excel in finding optimal or near-optimal

solutionssolutions

ILP models may be better for proving optimalityILP models may be better for proving optimality

Page 27: Case study 5: balanced academic curriculum problem

ConclusionsConclusions

Lesson 3Lesson 3: CP and ILP tools should provide efficient : CP and ILP tools should provide efficient

primitives for channelling between modelsprimitives for channelling between models

Lesson 4Lesson 4: careful integration of different models can : careful integration of different models can

result in better models despite the increase in the result in better models despite the increase in the

number of variables and constraintsnumber of variables and constraints

Page 28: Case study 5: balanced academic curriculum problem

Case study 6: Case study 6: Steel Mill Slab Steel Mill Slab

Design ProblemDesign ProblemJoint work with Alan Frisch Joint work with Alan Frisch

and Ian Migueland Ian Miguel

Page 29: Case study 5: balanced academic curriculum problem

OverviewOverview The slab design problemThe slab design problem An exampleAn example Model AModel A Model BModel B A dual model A/BA dual model A/B ResultsResults Conclusion/Future WorkConclusion/Future Work

Page 30: Case study 5: balanced academic curriculum problem

BackgroundBackground

• This work is based on the problem as stated in:

• “Variable Sized Bin Packing with Color Constraints”, Dawande, Kalagnanam and Sethuraman 1998.

• Approximation algorithms guaranteed to be within some bound of an optimal solution.

Page 31: Case study 5: balanced academic curriculum problem

MotivationMotivation Many problems exhibit flexibility in Many problems exhibit flexibility in

portions of their structure.portions of their structure. Example: the number required of a Example: the number required of a

certain type of variable.certain type of variable. Flexibility must be resolved during the Flexibility must be resolved during the

solution process.solution process. Slab design is a representative example of Slab design is a representative example of

this type of problem.this type of problem.

Page 32: Case study 5: balanced academic curriculum problem

The Slab Design The Slab Design ProblemProblem

The mill can make The mill can make different slab different slab sizes.sizes.

Given Given jj input orders with: input orders with: A A colourcolour (route through the mill). (route through the mill). A A weight.weight.

Pack orders onto slabs such that the Pack orders onto slabs such that the total slab capacity is minimised, subject total slab capacity is minimised, subject to:to: Capacity constraints.Capacity constraints. Colour constraints.Colour constraints.

Page 33: Case study 5: balanced academic curriculum problem

Slab Design ConstraintsSlab Design Constraints Capacity:Capacity:

Total weight of orders assigned to a Total weight of orders assigned to a slab cannot exceed slab capacity.slab cannot exceed slab capacity.

Colour:Colour: Each slab can contain at most Each slab can contain at most pp of of kk

total colours.total colours. Reason: expensive to cut slabs up to Reason: expensive to cut slabs up to

send them to different parts of the mill.send them to different parts of the mill.

Page 34: Case study 5: balanced academic curriculum problem

An ExampleAn Example

23

1 1 1 1 12

1

• Slab Sizes: {1, 3, 4} ( = 3)• Orders: {oa, …, oi} (j = 9) • Colours: {red, green, blue, orange, brown} (k = 5)• p = 2

a b c d e f g h i

Page 35: Case study 5: balanced academic curriculum problem

An Example Solution

23

111

1

1

1

f

g i

e

c d

b

h

a

• 6 Slabs:

(size 4) (size 3) (size 1)(size 1)(size 3) (size 1)

2

Page 36: Case study 5: balanced academic curriculum problem

RecipeRecipe

Create a basic modelCreate a basic model Decide on the variablesDecide on the variables

Introduce auxiliary variablesIntroduce auxiliary variables For messy/loose constraintsFor messy/loose constraints

Consider dual, combined or Consider dual, combined or 0/1 models0/1 models

Break symmetryBreak symmetry Add implied constraintsAdd implied constraints Customize solverCustomize solver

Variable, value orderingVariable, value ordering

Page 37: Case study 5: balanced academic curriculum problem

Basic modelBasic model

What are the variables?What are the variables? Need to assign sizes to slabsNeed to assign sizes to slabs Complicated because we don’t even Complicated because we don’t even

know how many slabs will be usedknow how many slabs will be used

Page 38: Case study 5: balanced academic curriculum problem

Model A – Redundant Model A – Redundant VariablesVariables

Slabs cannot be more than ordersSlabs cannot be more than orders Assuming greatest order weight does Assuming greatest order weight does

not exceed maximum slab sizenot exceed maximum slab size A list, A list, SS, of slab variables: {, of slab variables: {ss11, …, , …, ssjj}.}.

Domains size Domains size .. Solution quality:Solution quality:

∑ =i

i optVars

Page 39: Case study 5: balanced academic curriculum problem

Slab Variable Slab Variable RedundancyRedundancy

Some slab variables may be Some slab variables may be redundantredundant:: 0 is added to the domain of each 0 is added to the domain of each ssii..

If If ssii is not necessary to solve the problem, is not necessary to solve the problem, ssii = = 0.0.

Page 40: Case study 5: balanced academic curriculum problem

Slab Variable SymmetrySlab Variable Symmetry Slab variables are indistinguishable.Slab variables are indistinguishable. So model A suffers from symmetry:So model A suffers from symmetry:

Counteract with binary symmetry-breaking Counteract with binary symmetry-breaking constraints: constraints: ss11 ss22, , ss22 ss33, etc., etc.

Page 41: Case study 5: balanced academic curriculum problem

Basic modelBasic model

What are the variables?What are the variables? Need to assign orders to slabsNeed to assign orders to slabs Want to compute weight on each slab Want to compute weight on each slab

efficientlyefficiently

Page 42: Case study 5: balanced academic curriculum problem

Model A Order Matrix Model A Order Matrix (Oa)(Oa)

oa ob oc od

s1 0 0 1 1

s2 0 1 0 0

s3 1 0 0 0

s4 0 0 0 0

∑ =∀j

jiOai 1],[

j

i

i sjiOaoweightj ≤∀ ∑ ],[).(

Page 43: Case study 5: balanced academic curriculum problem

More Slab SymmetryMore Slab Symmetry Slab variables assigned the same Slab variables assigned the same

size are indistinguishablesize are indistinguishable If If ssii and and ssi+1i+1 have the same size, the have the same size, the

corresponding rows of the order corresponding rows of the order matrix are lexicographically matrix are lexicographically ordered.ordered.

E.g. 1001 E.g. 1001 0110. 0110.

Page 44: Case study 5: balanced academic curriculum problem

Colour constraintsColour constraints Need to count how many colours Need to count how many colours

used on a slabused on a slab Counting hardCounting hard

Channel into a matrix of 0/1 variables Channel into a matrix of 0/1 variables and sum rowsand sum rows

Page 45: Case study 5: balanced academic curriculum problem

Colour Matrix: colourMaColour Matrix: colourMaRed Green Blue Orange

s1 0 0 1 1

s2 0 1 0 0

s3 1 0 0 0

s4 0 0 0 0

Channelling: 1]2],[[1]2,[ =→= iirorderColoucolourMaiiOa

pjicolourMaji

≤∀ ∑ ],[

Page 46: Case study 5: balanced academic curriculum problem

Model A of the Example Problem

23

1 1 1 1 12

1oa ob oc od oe of og oh oi

oa ob oc od oe of og oh oi

s1 1

s2 1

Red Green Blue Orange Brown

s1 1

s2 1

Page 47: Case study 5: balanced academic curriculum problem

A Solution: Model A

23

1 1 1 1 12

1oa ob oc od oe of og oh oi

oa ob oc od oe of og oh oi

s1 0 0 0 0 0 0 1 1 1

s2 1 0 1 0 0 0 0 0 0

s3 0 1 0 0 0 0 0 0 0

s4 0 0 0 1 1 1 0 0 0

… 0 0 0 0 0 0 0 0 0

Red Green Blue Orange Brown

s1 0 0 0 1 1

s2 1 1 0 0 0

s3 0 1 0 0 0

s4 0 0 1 1 0

… 0 0 0 0 0

s1 = 4, s2 = 3, s3 = 3, s4 = 3, si = 0 (5 i 9)

Page 48: Case study 5: balanced academic curriculum problem

RecipeRecipe

Create a basic modelCreate a basic model Decide on the variablesDecide on the variables

Introduce auxiliary variablesIntroduce auxiliary variables For messy/loose constraintsFor messy/loose constraints

Consider dual, combined or Consider dual, combined or 0/1 models0/1 models

Break symmetryBreak symmetry Add implied constraintsAdd implied constraints Customize solverCustomize solver

Variable, value orderingVariable, value ordering

Page 49: Case study 5: balanced academic curriculum problem

Model A Implied Model A Implied ConstraintsConstraints

Combined weight of input orders is a lower Combined weight of input orders is a lower bound on optimisation variable:bound on optimisation variable:

Lower bound on number of slabs required:Lower bound on number of slabs required:∑ ≤

i

i optVaroweight )(

)(

)(

slabSizes

oweighti

i∑

• With symmetry-breaking constraints, decomposes into unary constraints on slab variables.

Page 50: Case study 5: balanced academic curriculum problem

Model A Implied Model A Implied Constraints (2)Constraints (2)

AssWtAssWti i is the weight of orders assigned to is the weight of orders assigned to ssii.. Prune domains by reasoning about reachable Prune domains by reasoning about reachable

values via dynamic programming [Trick, 2001].values via dynamic programming [Trick, 2001]. Incorporate both size and colour information.Incorporate both size and colour information. More powerful if done during search (future More powerful if done during search (future

work).work). Minimum number of slabs required:Minimum number of slabs required:

)max(

)(

AssWt

oweighti

i∑

Page 51: Case study 5: balanced academic curriculum problem

Model A Implied Model A Implied Constraints (3)Constraints (3)

WasteWasteii = s = sii – AssWt – AssWtii the unused portion of a slab.the unused portion of a slab.

Upper bound on total waste:Upper bound on total waste: Assume each order is assigned to an Assume each order is assigned to an

individual slab, with smallest size able individual slab, with smallest size able to hold it.to hold it.

Sum waste in each case: leads to Sum waste in each case: leads to upper bound for optimisation variable.upper bound for optimisation variable.

Upper bound on Upper bound on WasteWasteii is the worst of is the worst of these cases.these cases.

Page 52: Case study 5: balanced academic curriculum problem

Model B – AbstractionModel B – Abstraction 2-phase approach:2-phase approach:

1.1. Construct/solve an abstraction of the Construct/solve an abstraction of the problem.problem.

2.2. Solve independent sub-problems, Solve independent sub-problems, assigning a subset of the orders to slabs assigning a subset of the orders to slabs of a common size.of a common size.

Solving phase 2 sub-problems either:Solving phase 2 sub-problems either: Provides a solution to the original Provides a solution to the original

problem, or:problem, or: Identifies new constraints which restrict Identifies new constraints which restrict

set of solutions at phase 1.set of solutions at phase 1.

Page 53: Case study 5: balanced academic curriculum problem

Model B, Phase 1Model B, Phase 1

Number of slab sizes Number of slab sizes is is fixed.fixed. A list, Z, of slab size variables, {A list, Z, of slab size variables, {zz11, , zz22, ,

…}.…}. Domains: {0, …, Domains: {0, …, jj} number of slabs of } number of slabs of

corresponding sized used.corresponding sized used. Solution quality:Solution quality:

∑ =i

i optVariz

Page 54: Case study 5: balanced academic curriculum problem

Model B, Phase 1 Order Model B, Phase 1 Order Matrix (Ob)Matrix (Ob)

oa ob oc od

z1 0 0 1 1

z3 0 1 0 0

z4 1 0 0 0

∑ =∀j

jiObi 1],[

j

i

i jzjiOboweightj ≤∀ ∑ ],[).(

Page 55: Case study 5: balanced academic curriculum problem

Model B, Phase 1 Colour Matrix Model B, Phase 1 Colour Matrix ((ColourMbColourMb))

Red Green Blue Orange

z1 0 0 1 1

z3 0 1 0 0

z4 1 0 0 0

Channelling:

1]2],[[1]2,[ =→= iirorderColoucolourMbiiOb

pzjicolourMbj j

i

≤∀ ∑ ],[

Page 56: Case study 5: balanced academic curriculum problem

A Solution: Model B, Phase 1

23

1 1 1 1 12

1oa ob oc od oe of og oh oi

oa ob oc od oe of og oh oi

z1 0 0 0 0 0 0 0 0 0

z3 1 1 1 1 1 1 0 0 0

z4 0 0 0 0 0 0 1 1 1

Red Green Blue Orange Brown

z1 0 0 0 0 0

z3 1 1 1 1 0

z4 0 0 0 1 1

• z1 = 0, z3 = 3, z4 = 1

Page 57: Case study 5: balanced academic curriculum problem

Model B Implied Constraints

• Unary constraints on order matrix:

∑∑

≥i

ii

i

zAssWt

oweight

)max(

)(

∑ ≤i

i optVaroweight )(

0],[)()(: =→>∀∀ jiObjslabSizesoweightji i

Page 58: Case study 5: balanced academic curriculum problem

Model B, Phase 2Model B, Phase 2 Model B, Phase 1 is ambiguous.Model B, Phase 1 is ambiguous. A Phase 1 solution does provide:A Phase 1 solution does provide:

Number and sizes of slabs required.Number and sizes of slabs required. Size of slab each order is assigned to.Size of slab each order is assigned to. Quality of final solution.Quality of final solution.

Phase 1 solution used to construct Phase 1 solution used to construct much simpler, much simpler, independentindependent, phase 2 , phase 2 sub-problems.sub-problems.

Page 59: Case study 5: balanced academic curriculum problem

Model B, Phase 2 Sub-problems

23

1 1 1 1 12

1oa ob oc od oe of og oh oi

oa ob oc od oe of

s1 1 0 1 0 0 0

s2 0 1 0 0 0 0

s3 0 0 0 1 1 1

• 3 Slabs of size 3 • 1 Slab of size 4

og oh oi

s1 1 1 1

Page 60: Case study 5: balanced academic curriculum problem

The Price of AmbiguityThe Price of Ambiguity Model B, Phase 1 is Model B, Phase 1 is

ambiguous.ambiguous. Phase 2 sub-Phase 2 sub-

problems may be problems may be inconsistent.inconsistent.

Due to interaction Due to interaction between between weight/colour weight/colour constraints.constraints.

3 31 1

oa ob oc od

p = 1

oa ob oc od

s1 ? ? ? ?

s2 ? ? ? ?

• 2 Slabs of size 4

Page 61: Case study 5: balanced academic curriculum problem

Conflict RecordingConflict Recording Not simply underestimation of Not simply underestimation of

optimisation variable:optimisation variable: May be incorrect combination of slab sizes.May be incorrect combination of slab sizes. Or wrong assignment of orders to sizes.Or wrong assignment of orders to sizes.

Solution:Solution: Isolate reasons for failure.Isolate reasons for failure. Post constraints at phase 1.Post constraints at phase 1. Solve phase 1 again.Solve phase 1 again.

Example:Example: ooaa = 4 = 4 oobb = 4 = 4 oocc = 4 = 4 oodd = 4 = 4 zz44 > 2 > 2

Page 62: Case study 5: balanced academic curriculum problem

A Model B Solution A Model B Solution CycleCycle

Phase 1

Phase 2

Solution

Constraints

Page 63: Case study 5: balanced academic curriculum problem

RecipeRecipe

Create a basic modelCreate a basic model Decide on the variablesDecide on the variables

Introduce auxiliary variablesIntroduce auxiliary variables For messy/loose constraintsFor messy/loose constraints

Consider dual, combined or Consider dual, combined or 0/1 models0/1 models

Break symmetryBreak symmetry Add implied constraintsAdd implied constraints Customize solverCustomize solver

Variable, value orderingVariable, value ordering

Page 64: Case study 5: balanced academic curriculum problem

Combined Model A/BCombined Model A/B Model A and model B, phase 1.Model A and model B, phase 1. Variables:Variables:

Explicit slab variables (Explicit slab variables (ssii) and slab-size ) and slab-size variables (variables (zzii).).

Order matrices referring to explicit Order matrices referring to explicit slabs (slabs (OaOa) and to slab-sizes () and to slab-sizes (ObOb).).

Both types of colour matrix.Both types of colour matrix.

Page 65: Case study 5: balanced academic curriculum problem

Channelling Channelling ConstraintsConstraints

Constraints for individual models Constraints for individual models as previously described.as previously described.

Channelling constraints between Channelling constraints between the models maintain consistency, the models maintain consistency, aid pruning.aid pruning.

Between Between SS and and ZZ:: (Number of occurrences of (Number of occurrences of ii in in S)S) = =

zzii.. Between order matricesBetween order matrices and and SS::

Oa[i, j]Oa[i, j] = = 11 Ob[i, sOb[i, sjj]] = = 11..

Page 66: Case study 5: balanced academic curriculum problem

A/B Search StrategyA/B Search Strategy Instantiate model A variables first:Instantiate model A variables first:

Channelling constraints ensure Channelling constraints ensure model B variables instantiated.model B variables instantiated.

Analogous to pure model A approach.Analogous to pure model A approach. Instantiate model B variables first:Instantiate model B variables first:

Channelling constraints do not force Channelling constraints do not force instantiation of model A variables.instantiation of model A variables.

Model A variables Model A variables areare constrained constrained though.though.

Analogous to pure model B approach.Analogous to pure model B approach.

Page 67: Case study 5: balanced academic curriculum problem

A/B Search Strategies 2A/B Search Strategies 2 Other search strategies exploit more Other search strategies exploit more

complete view offered by model A/B.complete view offered by model A/B. Interleave instantiation of variables Interleave instantiation of variables

from 2 basic models:from 2 basic models: Obtain most efficient pruning of the Obtain most efficient pruning of the

search space.search space.

Page 68: Case study 5: balanced academic curriculum problem

ResultsResultsOrders Optimal Model A Model AB

12 77 83: 14, 0.1s78: 486, 0.2s77: 1841, 0.6s

83: 14, 0.1s78: 452, 0.2s77: 1714, 0.6s

13 79 83: 14, 0.1s80: 451, 0.2s79: 1536, 0.5s

83: 14, 0.1s80: 407, 0.2s79: 1447, 0.4s

14 87 95: 16, 0.1s89: 819, 0.2s88: 934, 0.3s87: 8797, 1.2s

95: 16, 0.1s89: 726, 0.3s88: 841, 0.4s87: 8612, 2.2s

15 92 95: 21, 0.1s94: 5108, 1.1s93: 5619, 1.2s92: 17734, 3.6s

95: 21, 0.2s94: 4950, 1.3s93: 5456, 1.5s92: 17190, 4.7s

Page 69: Case study 5: balanced academic curriculum problem

ResultsResultsOrders Optimal Model A Model AB

16 99 107: 17, 0.1s101: 5112, 0.9s100: 5305, 0.9s99: 92441, 17.8s

107: 17, 0.1s101: 3673, 0.9s100: 3866, 0.9s99: 89618, 23.5s

17 103 107: 23, 0.1s105: 13074, 2.6s104: 26757, 5.5s103: 237290, 50.2s

107: 23, 0.1s105: 11556, 2.9s104: 24792, 6.6s103: 228918, 67.1s

18 110 119: 19, 0.2s111: 1012, 0.4s110: 1179281, 253.4s

119: 19. 0.1s111: 977, 0.4s110: 1153031, 350.3s

Page 70: Case study 5: balanced academic curriculum problem

Model B Results?Model B Results?

On these problems, many solutions On these problems, many solutions at phase 1.at phase 1.

Cycle is therefore lengthy.Cycle is therefore lengthy. Improve efficiency:Improve efficiency:

Model phase 1 as a dynamic CSP.Model phase 1 as a dynamic CSP. Reduce arity of recorded constraints.Reduce arity of recorded constraints. Phase 1 heuristicsPhase 1 heuristics

Page 71: Case study 5: balanced academic curriculum problem

Other ModelsOther Models Set variables:Set variables:

Each represents a slabEach represents a slab Domain is set of orders assigned.Domain is set of orders assigned.

Activity-based dynamic CSP:Activity-based dynamic CSP: Model A slab variables used.Model A slab variables used. Only `activated’ according to remaining Only `activated’ according to remaining

capacity of activated slabs.capacity of activated slabs.

Page 72: Case study 5: balanced academic curriculum problem

ConclusionsConclusions Results only on small instances.Results only on small instances. All models need further All models need further

development:development: More implied constraints.More implied constraints. Better heuristicsBetter heuristics

Explore new models:Explore new models: Set variablesSet variables

Page 73: Case study 5: balanced academic curriculum problem

RecipeRecipe

Create a basic modelCreate a basic model Decide on the variablesDecide on the variables

Introduce auxiliary variablesIntroduce auxiliary variables For messy/loose constraintsFor messy/loose constraints

Consider dual, combined or Consider dual, combined or 0/1 models0/1 models

Break symmetryBreak symmetry Add implied constraintsAdd implied constraints Customize solverCustomize solver

Variable, value orderingVariable, value ordering