1
Lecture 7 Lecture 7 Linearization of Linearization of
a Quadratic Assignment Problem a Quadratic Assignment Problem Indicator VariablesIndicator Variables
2
OutlineOutline
Linearization of a Quadratic Assignment Linearization of a Quadratic Assignment Problem Problem
Indicator VariablesIndicator Variables
3
Linearization of Linearization of a Quadratic Assignment Problema Quadratic Assignment Problem
4
ExampleExample1, if { , , } is assigned to { , },0, . .ij
i a b c j AB Co w
1, ;
1, ;
{0,1}, { , , }, { , , }.
i ij
j ij
ij
j
i
i a b c i A B C
, , , 1, ,
1min ,2
nijkl ij kl
i j k li k j l
c
. .s t
5
Linearization of Linearization of the Quadratic Assignment Problem the Quadratic Assignment Problem
non-linear objective function with terms non-linear objective function with terms such as such as ijijklkl
to linearize the non-linear term to linearize the non-linear term ijijklkl
let let ijklijkl = = ij ij klkl
need to ensure that need to ensure that ijklijkl = 1 = 1 ij ij klkl = 1 = 1
6
Linearization of Linearization of the Quadratic Assignment Problem the Quadratic Assignment Problem
ijklijkl = 1 = 1 ij ij klkl = 1 = 1 ijklijkl = 1 = 1 ij ij = 1 and = 1 and klkl = 1 = 1
two parts two parts ijklijkl = 1 = 1 ij ij = 1 and = 1 and klkl = 1 = 1
ij ij = 1 and = 1 and klkl = 1 = 1 ijklijkl = 1= 1
trickstricks ijkl ijkl ijij and and ijkl ijkl kl kl
ijij + + klkl 1 + 1 + ijklijkl
7
Linearization of Linearization of the Quadratic Assignment Problem the Quadratic Assignment Problem
drawback of the methoddrawback of the method addition of one variable and three constraints addition of one variable and three constraints
for one cross-product for one cross-product nn((nn1)/2 cross products for 1)/2 cross products for nnijij’s ’s
any method to add less variables or less any method to add less variables or less constraintsconstraints
8
Linearization of Linearization of the Quadratic Assignment Problem the Quadratic Assignment Problem
three cross-products 2three cross-products 21122+3+311331144 of of
four variables four variables 11, , 22, , 33, , 44
the previous method: 3 new variables and 9 the previous method: 3 new variables and 9 new constraints new constraints
another method with 1 new variable and 3 another method with 1 new variable and 3 new constraintsnew constraints
9
Linearization of Linearization of the Quadratic Assignment Problem the Quadratic Assignment Problem
let let ww = 2 = 21122+3+311331144 = = 11(2(222+3+33344))
hope to have: hope to have: 11 = 1 = 1 ww = 2 = 222+3+33344, and , and 11
= 0 = 0 ww = 0 = 0 possible values of possible values of ww {-1, 0, 1, 2, 3, 4, 5} {-1, 0, 1, 2, 3, 4, 5}
11 = 0 = 0 ww = 0: = 0: ww 5 511
how to model how to model 11 = 1 = 1 ww = 2 = 222+3+33344??
10
Linearization of Linearization of the Quadratic Assignment Problem the Quadratic Assignment Problem
to model to model 11 = 1 = 1 ww = 2 = 222+3+33344
ww = 2 = 222+3+33344
ww 2 222+3+33344 and and ww 2 222+3+33344
11 = 1 = 1 ww 2 222+3+33344 and and ww 2 222+3+33344 when when 11 = 1: two valid constraints = 1: two valid constraints
ww 2 222+3+33344 and and ww 2 222+3+33344
when when 11 = 0: two redundant constraints = 0: two redundant constraints
ww 2 222+3+33344+5+55511 and and ww 2 222+3+33344+5+51155 mind that when mind that when 11 = 0, = 0, ww = 0 by = 0 by ww 5 511
11
Indicator VariablesIndicator Variables
12
To Model the Setup CostTo Model the Setup Cost
cost to produce cost to produce xx items, items, xx {0, 1, 2, …} {0, 1, 2, …}cc((xx) = 0 if ) = 0 if xx = 0, and = 0, and cc((xx) = ) = ff + + ax ax if if xx > >
00 suppose there exists suppose there exists = 1 = 1 xx > 0, i.e., > 0, i.e., = 1 = 1
for for xx > 0 and > 0 and = 0 for = 0 for xx = 0 = 0 then then cc((xx) = ) = ff + + ax ax Question: how to construct such a Question: how to construct such a ??
13
To Model the Setup CostTo Model the Setup Cost
= 1 x > 0 means that = 1 x > 0 and x > 0 = 1 let max{0, let max{0, xx} < } < MM and and > 0 such that > 0 such that MM is practically infinity is practically infinity
and and < 1 < 1 to model to model = 1 x > 0
xx to model to model x > 0 = 1
xx MM to model to model = 1 x > 0
xx and and xx MM
14
To Model the Setup CostTo Model the Setup Cost
cost to produce cost to produce xx items, items, xx {0, 1, 2, …} {0, 1, 2, …} cc((xx) = 0 if ) = 0 if xx = 0, and = 0, and cc((xx) = 10 + 4) = 10 + 4xx, if , if xx > 0 > 0
if there exists if there exists = 1 = 1 xx > 0, then > 0, then cc((xx) = ) = 1010+4+4xx
question: how to define such a question: how to define such a ? ? xx > 0 > 0 = 1 and = 1 and = 1 = 1 xx > 0 > 0
15
To Model the Setup CostTo Model the Setup Cost
xx > 0 > 0 = 1 = 1 let let MM be a large positive number be a large positive number xx MM
= 1 = 1 xx > 0 > 0 (( = 1 = 1 xx > 0) > 0) ( (xx = 0 = 0 = 0) = 0) let let be a small positive number be a small positive number xx
16
To Model the Setup CostTo Model the Setup Cost
cost to produce cost to produce xx items, items, xx {0, 1, 2, …} {0, 1, 2, …} cc((xx) = 0 if ) = 0 if xx = 0, and = 0, and cc((xx) = 10 + 4) = 10 + 4xx, if , if x > x > 0 0
then then cc((xx) = 10) = 10 + 4 + 4xx, where , where x,x, and and
xx MM (plus some other constraints for (plus some other constraints for xx) )
17
Simplifying the Formulation Simplifying the Formulation by Problem Structure by Problem Structure
minimizationminimization min min cc((xx) = 10) = 10 + 4 + 4xx, where , where xx MM (plus (plus
some other constraints for some other constraints for xx) ) question: is it possible to omit question: is it possible to omit xx??
function of the constraint: function of the constraint: xx = 0 = 0 = 0 = 0 for minimization, even without the constraint, for minimization, even without the constraint,
will be forced to 0 at minimum if will be forced to 0 at minimum if xx = 0 = 0
18
An Indicator An Indicator to Represent a to Represent a -Constraint-Constraint
19
ContextContext
two types of goods, type 1 and type 2 weight of each piece
type 1: 2 ton
type 2: 5 ton
capacity of a truck: 9 ton
20
Model Model = 1 = 1 -Constraint-Constraint let be the number of trucks decided by the manager if is set to 1, i.e., the manager has decided to use 1
truck, x1 and x2 satisfy certain relationship = 1 2x1 + 5x2 9 how to model the relationship between and the
constraint 2x1 + 5x2 9? need to have something
giving 2x1 + 5x2 9 if = 1 Having no effect if = 0
2x1 + 5x2 + M M + 9
21
Model Model -Constraint -Constraint = 1 = 1
let be the number of trucks if the amount of goods 9 ton, only one vehicle is
needed 2x1 + 5x2 9 = 1 how to model the relationship between and the
constraint 2x1 + 5x2 9? need to have something
when 2x1 + 5x2 9, = 1
Having no effect if 2x1 + 5x2 > 9
9 2x1 5x2 + M 2x1 + 5x2 + M 9+
22
Model Model = 1 = 1 -Constraint-Constraint
= the number or trucks used = the number or trucks used = 1 = 1 iffiff the amount of good is no more than 9 the amount of good is no more than 9
tonton combining the two casescombining the two cases
2x1 + 5x2 + M M + 9 and 2x1 + 5x2 + M 9+
consider 2x1 + 5x2 + M 9+
= 0 2x1 + 5x2 + M 9+ = 0 2x1 + 5x2 > 9
2x1 + 5x2 9 = 1
23
An Indicator An Indicator to Represent a to Represent a -Constraint-Constraint
24
Model Model = 1 = 1 -Constraint-Constraint let be the indicator that the manager orders wasting no
capacity If the manager orders wasting no capacity, the truck is loaded at
least to full capacity = 1 2x1 + 5x2 9 how to model the relationship between and the constraint 2x1 +
5x2 9? need to have something
if = 1, 2x1 + 5x2 9 if = 0, the manager has said nothing, the truck may or may not loaded to
capacity
2x1 + 5x2 + M M + 9
25
Model Model -Constraint -Constraint = 1 = 1
now suppose that there is no wasted capacity only if the manager has said so
2x1 + 5x2 9 = 1 how to model the relationship between and
the constraint 2x1 + 5x2 9? need to have something
if 2x1 + 5x2 9, = 1 if 2x1 + 5x2 < 9, there is no constraint on
2x1 + 5x2 ≤ M + 9 -
26
Model Model -Constraint -Constraint = 1 = 1
combining the previous two cases combining the previous two cases 2x1 + 5x2 + M M + 9 and 2x1 + 5x2 ≤ M + 9 -
27
An Indicator An Indicator to Represent a =-Constraintto Represent a =-Constraint
28
=-Constraint=-Constraint
an equality constraint an equality constraint an an - constraint and an - constraint and an --
constraint constraint
29
Model Model = 1 = 1 =-Constraint =-Constraint
= 1 2x1 + 5x2 = 9
= 1 (2x1 + 5x2 9 and 2x1 + 5x2 9)
from the previous results
2x1 + 5x2 + M M + 9, and
2x1 + 5x2 + M M + 9
30
Model =-Constraint Model =-Constraint = 1 = 1
2x1 + 5x2 = 9 = 1 = 0 2x1 + 5x2 9
2x1 + 5x2 9: either 2x1 + 5x2 < 9 or 2x1 + 5x2 > 9, but not both
from previous results: 2x1 + 5x2 + M1 9 + , 2x1 + 5x2 + M2 + 9
1 + 2 = + 1
31
Model =-Constraint Model =-Constraint = 1 = 1
to model 2x1 + 5x2 = 9 iff = 1 2x1 + 5x2 + M M + 9, 2x1 + 5x2 + M M + 9, 2x1 + 5x2 + M1 9 + , 2x1 + 5x2 M2 + 9, 1 + 2 = + 1.