Slid
e 1
A T
our
of M
odel
ing
Tec
hniq
ues
John
Hoo
ker
Car
negi
e M
ello
n U
nive
rsity
Mar
ch 2
008
Slid
e 2
Ou
tlin
e
•M
ixed
inte
ger
linea
r(M
ILP
) m
odel
ing
•D
isju
nctiv
e m
odel
ing
•E
xam
ples
: fix
ed c
harg
e pr
oble
ms,
faci
lity
loca
tion,
lo
t siz
ing
with
set
up c
osts
.
•K
naps
ack
mod
elin
g
•E
xam
ples
: Fre
ight
pac
king
and
tran
sfer
•C
onst
rain
t pro
gram
min
g m
odel
s
•E
xam
ple:
Em
ploy
ee s
ched
ulin
g
•In
tegr
ated
Mod
els
•E
xam
ples
: Pro
duct
con
figur
atio
n, m
achi
ne s
ched
ulin
g
Slid
e 3
Mix
ed In
teg
er/L
inea
r M
od
elin
g
MIL
P M
odel
ing
Sys
tem
sM
ILP
Mod
els
Dis
junc
tive
Mod
elin
gK
naps
ack
Mod
elin
g
Slid
e 4
MIL
P M
od
elin
g S
yste
ms
•C
omm
erci
al m
odel
ing
syst
ems
•AM
PL
•G
AM
S
•AIM
MS
Slid
e 5
MIL
P M
od
elin
g S
yste
ms
•C
omm
erci
al m
odel
ing
syst
ems
with
ded
icat
ed s
olve
rs
•O
PL
Stu
dio
(run
s C
PLE
X)
•X
pres
s-B
CL
(run
s X
pres
s-M
P)
•X
pres
s-M
osel
(ru
ns X
pres
s-M
P)
•E
xcel
and
Qua
ttro
Pro
, Fro
ntlin
e S
yste
ms
(spr
eads
heet
bas
ed)
•LI
NG
O
•M
INO
PT
(al
so n
onlin
ear)
Slid
e 6
MIL
P M
od
elin
g S
yste
ms
•N
on-c
omm
erci
al m
odel
ing
syst
ems
•Z
IMP
L
•G
nu M
athp
rog
(GM
PL)
Slid
e 7
An
mix
ed in
teg
er li
nea
r p
rog
ram
min
g
(MIL
P)
mod
el h
as th
e fo
rmm
in ,0
inte
ger
cxdy
Ax
byb
xy
y
++
≥≥
MIL
P m
od
els
Slid
e 8
A p
rin
cip
led
ap
pro
ach
to
MIL
P m
od
elin
g
•M
ILP
mod
elin
g co
mbi
nes
two
dist
inct
kin
ds o
f mod
elin
g.
•M
odel
ing
of s
ubse
ts o
f con
tinuo
us s
pace
, usi
ng 0
-1 a
uxili
ary
varia
bles
.
•K
naps
ack
mod
elin
g, u
sing
gen
eral
inte
ger
varia
bles
.
•M
ILP
can
mod
el s
ubse
ts o
f con
tinuo
us s
pace
that
are
uni
ons
of
poly
hedr
a.
•…
that
is, r
epre
sent
ed b
y di
sjun
ctio
ns o
f lin
ear
syst
ems.
•S
o a
prin
cipl
ed a
ppro
ach
is to
ana
lyze
the
pro
blem
as
disj
unct
ions
in
tege
r
of li
near
+
kn
apsa
ck
sy
stem
s
i
nequ
aliti
es
Slid
e 9
Dis
jun
ctiv
e M
od
elin
g
Th
eore
m. A
sub
set o
f con
tinuo
us s
pace
can
be
repr
esen
ted
by a
n M
ILP
mod
el if
and
onl
y if
it is
the
unio
n of
fini
tely
man
y po
lyhe
dra
havi
ng t
he s
ame
rece
ssio
n co
ne.
Pol
yhed
ron
Rec
essi
on c
one
of p
olyh
edro
n
Uni
on o
f pol
yhed
ra w
ith th
e sa
me
rece
ssio
n co
ne
(in th
is c
ase,
the
orig
in)
Slid
e 10
Mo
del
ing
a u
nio
n o
f p
oly
hed
ra
Sta
rt w
ith a
dis
junc
tion
of li
near
sy
stem
s to
rep
rese
nt th
e un
ion
of p
olyh
edra
.
The
kth
pol
yhed
ron
is {
x | A
k x ≥
b}
()
min
kk
k
cx
Ax
b≥
∨
Intr
oduc
e a
0-1
varia
ble
yk
that
is
1 w
hen
xis
in p
olyh
edro
n k.
Dis
aggr
egat
e x
to c
reat
e an
xk
for
each
k.
{}
min
, al
l
1
0,1
kk
kk
kk
k
k
k
cx
Ax
by
k
y
xx
y
≥ =
= ∈
∑
∑
Slid
e 11
Tig
ht
Rel
axat
ion
s
•B
asic
fac
t:T
he c
ontin
uous
rel
axat
ion
of th
e di
sjun
ctiv
e M
ILP
m
odel
pro
vide
s a
con
vex
hu
ll re
laxa
tio
nof
the
disj
unct
ion.
•T
his
is th
e tig
htes
t pos
sibl
e lin
ear
mod
el fo
r th
e di
sjun
ctio
n.
Uni
on o
f pol
yhed
raC
onve
x hu
ll re
laxa
tion
(tig
htes
t lin
ear
rela
xatio
n)
Slid
e 12
Exa
mp
le: F
ixed
ch
arg
e fu
nct
ion
Min
imiz
e a
fixed
cha
rge
func
tion:
x 1
x 2
2
12
11
1min
0if
0
if 0
0x
xx
fcx
x
x
=
≥
+
>
≥
Slid
e 13
Fix
ed c
harg
e pr
oble
m
Min
imiz
e a
fixed
cha
rge
func
tion:
2
12
11
1min
0if
0
if 0
0x
xx
fcx
x
x
=
≥
+
>
≥
x 1
x 2
Fea
sibl
e se
t
Slid
e 14
Fix
ed c
harg
e pr
oble
m
Min
imiz
e a
fixed
cha
rge
func
tion:
2
12
11
1min
0if
0
if 0
0x
xx
fcx
x
x
=
≥
+
>
≥
x 1
x 2
Uni
on o
f tw
o po
lyhe
dra
P1,
P2
P1
Slid
e 15
Fix
ed c
harg
e pr
oble
m
Min
imiz
e a
fixed
cha
rge
func
tion:
2
12
11
1min
0if
0
if 0
0x
xx
fcx
x
x
=
≥
+
>
≥
x 1
x 2
Uni
on o
f tw
o po
lyhe
dra
P1,
P2
P1
P2
Slid
e 16
Fix
ed c
harg
e pr
oble
m
Min
imiz
e a
fixed
cha
rge
func
tion:
2
12
11
1min
0if
0
if 0
0x
xx
fcx
x
x
=
≥
+
>
≥
x 1
x 2
The
po
lyhe
dra
have
di
ffere
nt
rece
ssio
n co
nes.
P1
P1
rece
ssio
nco
ne
P2
P2
rece
ssio
nco
ne
Slid
e 17
Fix
ed c
harg
e pr
oble
m
Min
imiz
e a
fixed
cha
rge
func
tion:
Add
an
uppe
r bo
und
on x
1
2
12
11
1
min
0if
0
if
0
0
x
xx
fcx
x
xM
=
≤
≥
+
>
≤
x 1
x 2
The
po
lyhe
dra
have
the
sam
e re
cess
ion
cone
.P
1
P1
rece
ssio
nco
ne
P2
P2
rece
ssio
nco
neM
Slid
e 18
Fix
ed c
harg
e pr
oble
m
Sta
rt w
ith a
dis
junc
tion
of
linea
r sy
stem
s to
rep
rese
nt
the
unio
n of
pol
yhed
ra
2
11
22
1
min
00
0x
xx
M
xx
fcx
=≤
≤
∨
≥≥
+
x 1
x 2
P1
P2
M
Slid
e 19
Fix
ed c
harg
e pr
oble
m
Sta
rt w
ith a
dis
junc
tion
of
linea
r sy
stem
s to
rep
rese
nt
the
unio
n of
pol
yhed
ra
2
11
22
1
min
00
0x
xx
M
xx
fcx
=≤
≤
∨
≥≥
+
{}
2
12
11
21
22
21
22
12 1
21
21
11
22
2
min
00
0
1,
0,1
,k
x
xx
My
xcx
xfy
yy
y
xx
xx
xx
=≤
≤≥
−+
≥+
=∈
=+
=+
Intr
oduc
e a
0-1
varia
ble
yk
that
is 1
whe
n x
is in
po
lyhe
dron
k.
Dis
aggr
egat
e x
to c
reat
e an
xk
for
each
k.
Slid
e 20
{}
2
12
11
21
22
21
22
12 1
21
21
11
22
2
min
00
0
1,
0,1
,k
x
xx
My
xcx
xfy
yy
y
xx
xx
xx
=≤
≤≥
−+
≥+
=∈
=+
=+
To s
impl
ify, r
epla
ce
w
ith x
1 si
nce
2 1x1 1
0x
=
Slid
e 21
{}
2
21
22
22
12 1
22
2
1
1
2
min
0
0
1,
0,1
k
x
My
xc
xfy
yy
y
xx
x
x
x≤≤
≥−
+≥
+=
∈=
+
To s
impl
ify, r
epla
ce
w
ith x
1 si
nce
2 1x1 1
0x
=
Slid
e 22
{}
2
12
12
21
22
12 1
22
22
min
0
0
1,
0,1
k
x
xM
y
xcx
xfy
yy
y
xx
x
≤≤
≥−
+≥
+=
∈=
+
Rep
lace
with
x2
beca
use
play
s no
rol
e in
the
mod
el
2 2x 1 2x
Slid
e 23
{}
2
12
12
1
2
2
min
0
1,
0,1
k
x
xM
y
cxfy
x
yy
y
≤≤
−+
≥+
=∈
Rep
lace
with
x2
Bec
ause
pla
ys n
o ro
le in
the
mod
el
2 2x 1 2x
Slid
e 24
{}
2
12
12
2
12
min
0
1,
0,1
k
x
xM
y
cxx
fy
yy
y
≤≤
−+
≥+
=∈
Rep
lace
y2
with
y
Bec
ause
y2
play
s no
rol
e in
the
mod
el
Slid
e 25
{}
2
1
21
min
0
0,1
x xM
xcx
y yf
y
≤≤
≥+
∈Rep
lace
y2
with
y
Bec
ause
y2
play
s no
rol
e in
the
mod
el
{}
min
0
0,1
cxfy
xM
y
y
+≤
≤∈
or
“Big
M”
Slid
e 26
Exa
mp
le:
Un
cap
acit
ated
faci
lity
loca
tio
n
ij
f ic i
j
Fix
ed
cost
Tra
nspo
rt
cost
mpo
ssib
le
fact
ory
loca
tions
nm
arke
tsLo
cate
fact
orie
s to
ser
ve
mar
kets
so
as to
min
imiz
e to
tal f
ixed
cos
t and
tr
ansp
ort c
ost.
No
limit
on p
rodu
ctio
n ca
paci
ty o
f eac
h fa
ctor
y.
Slid
e 27
Unc
apac
itate
d fa
cilit
y lo
catio
n
ij
f ic i
j
Fix
ed
cost
Tra
nspo
rt
cost
nm
arke
tsD
isju
nctiv
e m
odel
:
min 0
1, a
ll 0,
all
, a
ll 0
1, a
ll
iij
iji
ij
ijij
ii
i
iji
zc
x
xj
xj
iz
fz
xj
+
≤≤
=
∨
≥=
=∑∑
∑
Fac
tory
at
loca
tion
iN
o fa
ctor
yat
loca
tion
i
Fra
ctio
n of
m
arke
t j’s
dem
and
satis
fied
from
lo
catio
n i
mpo
ssib
le
fact
ory
loca
tions
Slid
e 28
Unc
apac
itate
d fa
cilit
y lo
catio
n
MIL
P f
orm
ulat
ion:
Dis
junc
tive
mod
el:
{}
12
12
12
12
min
0,
all
,0,
all
,
, all
0, a
ll
,
,
0,1
1, a
ll
iij
iji
ij
iji
ij
ii
ii
ijij
iji
ii
i
iji
zc
x
xy
ij
xi
j
zfy
iz
i
xx
xz
zz
y
xj
+
≤≤
=≥
==
+=
+∈
=∑∑
∑min 0
1, a
ll 0,
all
, a
ll 0
1, a
ll
iij
iji
ij
ijij
ii
i
iji
zc
x
xj
xj
iz
fz
xj
+
≤≤
=
∨
≥=
=∑∑
∑
Slid
e 29
Unc
apac
itate
d fa
cilit
y lo
catio
n
Let
si
nce
1 ijij
xx
=2
0ijx
=
Let
si
nce
1 ii
zz
=2
0iz
=
MIL
P f
orm
ulat
ion:
{}
12
12
12
12
min
0,
all
,0,
all
,
, all
0, a
ll
,
,
0,1
1, a
ll
iij
iji
ij
iji
ij
ii
ii
ijij
iji
ii
i
iji
zc
x
xy
ij
xi
j
zfy
iz
i
xx
xz
zz
y
xj
+
≤≤
=≥
==
+=
+∈
=∑∑
∑
Slid
e 30
Unc
apac
itate
d fa
cilit
y lo
catio
n
Let
si
nce
{}
min
0,
all
,
, all
0,1 1,
all
iij
iji
ij
i
ii
i
ij
ij
i i
x
z
zc
x
yi
j
fyi
y
xj
+
≤≤
≥ ∈=∑
∑
∑
1 ijij
xx
=2
0ijx
=
Let
si
nce
1 ii
zz
=2
0iz
=
MIL
P f
orm
ulat
ion:
Slid
e 31
Unc
apac
itate
d fa
cilit
y lo
catio
n
Let
si
nce
{}
min
0,
all
,
, all
0,1 1,
all
iij
iji
ij
i
ii
i
ij
ij
i i
x
z
zc
x
yi
j
fyi
y
xj
+
≤≤
≥ ∈=∑
∑
∑
1 ijij
xx
=2
0ijx
=
Let
si
nce
1 ii
zz
=2
0iz
=
{}
min
0,
all
,
0,1 1,
all
ii
ijij
iij
iji
i
iji
cx
xy
i
f
j
y
x
y
j+
≤≤
∈=∑
∑
∑
or
MIL
P f
orm
ulat
ion:
Slid
e 32
Unc
apac
itate
d fa
cilit
y lo
catio
n
MIL
P f
orm
ulat
ion:
Beg
inne
r’s m
odel
:
{}
min
, a
ll
0,1 1,
all
ii
ijij
iij
iji
j i
iji
fyc
x
xny
i
y
xj+
≤
∈=∑
∑
∑ ∑
Bas
ed o
n ca
paci
tate
d lo
catio
n m
odel
.
It ha
s a
wea
ker
con
tin
uo
us
rela
xati
on
Thi
s be
ginn
er’s
mis
take
can
be
avoi
ded
by
star
ting
with
dis
junc
tive
form
ulat
ion.
Max
imum
out
put
from
loca
tion
i
{}
min
0,
all
,
0,1 1,
all
ii
ijij
iij
iji
i
iji
fyc
x
xy
ij
y
xj+
≤≤
∈=∑
∑
∑
Slid
e 33
Exa
mp
le:
Lo
t si
zin
g w
ith
set
up
co
sts
Det
erm
ine
lot s
ize
in e
ach
perio
d to
min
imiz
e to
tal
prod
uctio
n, in
vent
ory,
and
set
up c
osts
.
t =0
12
34
56
Dem
and
=D
0D
1D
2D
3D
4D
5D
6
Max
pr
oduc
tion
leve
l
Set
up c
ost i
ncur
red
Slid
e 34
00
00
0t
tt
tt
tt
tt
t
vf
vv
xC
xC
x
≥≥
≥
∨
∨
≤
≤≤
≤=
(1)
Sta
rt
prod
uctio
n(in
curs
set
up
cost
)
(2)
Con
tinue
pr
oduc
tion
(no
setu
p co
st)
(3)
Pro
duce
no
thin
g(n
o pr
oduc
tion
cost
)
Fix
ed-c
ost
varia
ble
Fix
ed
cost
Pro
duct
ion
leve
lP
rodu
ctio
n ca
paci
ty
Logi
cal c
ondi
tions
:
(2)
In p
erio
d t⇒
(1)
or (
2) in
per
iod
t−1
(1)
In p
erio
d t⇒
neith
er (
1) n
or (
2) in
per
iod
t−1
Slid
e 35
00
00
0t
tt
tt
tt
tt
t
vf
vv
xC
xC
x
≥≥
≥
∨
∨
≤
≤≤
≤=
(1)
Sta
rt
prod
uctio
n
(2)
Con
tinue
pr
oduc
tion
(3)
Pro
duce
no
thin
g
11
11
0t
tt
tt
t
vfy
xC
y
≥≤
≤
2 22
0
0t t
tt
v xC
y
≥≤
≤
3 3
0 0t tv x
≥ =
33
3
11
1
,,
{0,1
},
1,2,
3
kk
tt
tt
ttk
kk
k
tk
vv
xx
yy
yk
==
=
==
=
∈=
∑∑
∑
Con
vex
hull
MIL
P m
odel
of d
isju
nctio
n:
Slid
e 36
11
11
0t
tt
tt
t
vfy
xC
y
≥≤
≤
2 22
0
0t t
tt
v xC
y
≥≤
≤
3 3
0 0t tv x
≥ =
33
3
11
1
,,
{0,1
},
1,2,
3
kk
tt
tt
ttk
kk
k
tk
vv
xx
yy
yk
==
=
==
=
∈=
∑∑
∑
Con
vex
hull
MIL
P m
odel
of d
isju
nctio
n:
To s
impl
ify, d
efin
e
z t=
yt1
y t=
yt2
Slid
e 37
1
10
t
ttt
t
tvf
x
z
zC
≥≤
≤
2 2
0
0t
t tt
v xy
C
≥≤
≤
3 3
0 0t tv x
≥ =
33
11
,,
{0,1
},
1,
1
2,3
,kk
tt
tt
tt
tt
kk
vv
xx k
zy
zy
==
+
∈=
≤=
=∑
∑
Con
vex
hull
MIL
P m
odel
of d
isju
nctio
n:
To s
impl
ify, d
efin
e
z t=
yt1
y t=
yt2
= 1
for
star
tup
= 1
for
cont
inue
d pr
oduc
tion
Slid
e 38
1
10
tt
t
tt
t
vfz
xC
z
≥≤
≤
2 2
0
0t t
tt
v xC
y
≥≤
≤
3 3
0 0t tv x
≥ =
33
11
,,
1
,{0
,1},
1,
2,3
kk
tt
tt
tt
kk
tt
vv
xx
zy
zy
k=
=
==
+≤
∈=
∑∑
Con
vex
hull
MIL
P m
odel
of d
isju
nctio
n:
Sin
cese
t
30
tx= 1
2t
tt
xx
x=
+
Slid
e 39
1
0(
)t
tt
t
tt
tx
Cy
vz z
f
≤≤
+≥
20
tv≥
30
tv≥
3
1
,1
,{0
,1},
1,
2,3
kt
tt
tk
tt
vv
zy
zy
k=
=+
≤
∈=
∑
Con
vex
hull
MIL
P m
odel
of d
isju
nctio
n:
Sin
cese
t
30
tx= 1
21
12
xx
x=
+
Slid
e 40
1
0(
)t
tt
tt
tt
vfz
xC
zy
≥≤
≤+
20
tv≥
30
tv≥
3
1
,1
,{0
,1},
1,
2,3
kt
tt
tk
tt
vv
zy
zy
k=
=+
≤
∈=
∑
Con
vex
hull
MIL
P m
odel
of d
isju
nctio
n:
Sin
ce v
t occ
urs
posi
tivel
y in
the
obje
ctiv
e fu
nctio
n,
and
d
o no
t pla
y a
role
, let
2
3,
tt
vv
1t
tv
v=
Slid
e 41
0(
)t
tt
tt
tt
vfz
xC
zy
≥≤
≤+ 1
,{0
,1},
1,
2,3
tt
tt
zy
zy
k
+≤
∈=
Con
vex
hull
MIL
P m
odel
of d
isju
nctio
n:
Sin
ce v
t occ
urs
posi
tivel
y in
the
obje
ctiv
e fu
nctio
n,
and
d
o no
t pla
y a
role
, let
2
3,
tt
vv
1t
tv
v=
Slid
e 42
0(
)t
tt
tt
tt
vfz
xC
zy
≥≤
≤+
11
11
1
,{0
,1},
1,
2,3
1t
tt
t
t
t
t
t
tt
yz
y
zy
z
zz
y
y
k
−−
−−
+
≤∈ ≤
−≤=
+−
For
mul
ate
logi
cal c
ondi
tions
:
(2)
In p
erio
d t⇒
(1)
or (
2) in
per
iod
t−1
(1)
In p
erio
d t⇒
neith
er (
1) n
or (
2) in
per
iod
t−1
Slid
e 43
1
m
0(
)
in(
)n
tt
tt
tt
tt
t
tt
tt
vfz
x
px
hs
z
v
Cy
=
≥≤
≤+
++
∑
11
11
1
,{0
,1},
1,
2,3
1tt
tt
tt
t
tt
t
zy
zy
k
yz
y
zz
y−
−
−−
+≤
∈=
≤+
≤−
−
Add
obj
ectiv
e fu
nctio
n
Uni
t pro
duct
ion
cost
Uni
t hol
ding
cos
t
Slid
e 44
Kn
apsa
ck M
od
els
Inte
ger
varia
bles
can
als
o be
use
d to
exp
ress
cou
ntin
g id
eas.
Thi
s is
tota
lly d
iffer
ent f
rom
the
use
of 0
-1 v
aria
bles
to
expr
ess
unio
ns o
f pol
yhed
ra.
Slid
e 45
Exa
mp
le: F
reig
ht
Tran
sfer
•T
rans
port
42
tons
of f
reig
ht u
sing
8 tr
ucks
, whi
ch c
ome
in
4 si
zes…
Tru
ck
size
Num
ber
avai
labl
eC
apac
ity
(ton
s)
Cos
t pe
r tr
uck
13
790
23
560
33
450
43
340
Slid
e 46
Tru
ck
type
Num
ber
avai
labl
eC
apac
ity
(ton
s)
Cos
t pe
r tr
uck
13
790
23
560
33
450
43
340
12
34
12
34
12
34
min
90
6050
40
75
43
42
8
{0,1
,2,3
}i
xx
xx
xx
xx
xx
xx
x
++
++
++
≥+
++
≤∈
Num
ber
of tr
ucks
of t
ype
1
Kna
psac
k co
verin
g co
nstr
aint
Kna
psac
k pa
ckin
g co
nstr
aint
Slid
e 47
Exa
mp
le: F
reig
ht
Pac
kin
g a
nd
Tra
nsf
er
•T
rans
port
pac
kage
s us
ing
ntr
ucks
•E
ach
pack
age
jhas
siz
e a j
.
•E
ach
truc
k ih
as c
apac
ity Q
i.
Slid
e 48
Kna
psac
k co
mpo
nent
The
truc
ks s
elec
ted
mus
t hav
e en
ough
cap
acity
to
carr
y th
e lo
ad.
1n
ii
ji
j
Qy
a=
≥∑
∑
= 1
if tr
uck
iis
sele
cted
Slid
e 49
Dis
junc
tive
com
pone
nt (
with
em
bedd
ed k
naps
ack
cons
trai
nt)
0 0
01,
all
ii
ij
iji
jij
ijzc
za
xQ
x
xj
≥
≥
≤∨
=
≤≤
∑
Tru
ck i
sele
cted
Tru
ck i
not
sele
cted
= 1
if p
acka
ge j
is
load
ed o
n tr
uck
i
Cos
t of o
pera
ting
truc
k i
Cos
t var
iabl
e
Use
con
tinuo
us
rela
xatio
n be
caus
e w
e w
ant
a di
sjun
ctio
n of
lin
ear
syst
ems
Slid
e 50
0 0
01,
all
ii
ij
iji
jij
ijzc
za
xQ
x
xj
≥
≥
≤∨
=
≤≤
∑
Tru
ck i
sele
cted
Tru
ck i
not
sele
cted
0
ii
i
jij
ii
j
iji
zc
y
ax
Qy
xy
≥≤
≤≤
∑
Con
vex
hull
MIL
P
form
ulat
ion
Dis
junc
tive
com
pone
nt (
with
em
bedd
ed k
naps
ack
cons
trai
nt)
Slid
e 51
The
res
ultin
g m
odel
Dis
junc
tive
com
pone
nt
Logi
cal c
ondi
tion
(eac
h pa
ckag
e m
ust b
e sh
ippe
d)
Kna
psac
k co
mpo
nent
1
1 1min
, a
ll
0,
all
,
1 ,
all
,{0
,1}
n
ii
i
jij
ii
j
iji
n
iji
n
ii
ji
j
iji
cy
ax
Qy
i
xy
ij
xj
Qy
a
xy
=
= =
≤
≤≤ =
≥ ∈∑
∑
∑ ∑∑
Slid
e 52
The
res
ultin
g m
odel
1
1 1min
, a
ll
0,
all
,
1 ,
all
,{0
,1}
n
ii
i
jij
ii
j
iji
n
iji
n
ii
ji
j
iji
cy
ax
Qy
i
xy
ij
xj
Qy
a
xy
=
= =
≤
≤≤ =
≥ ∈∑
∑
∑ ∑∑
The
yiis
red
unda
nt b
ut m
akes
th
e co
ntin
uous
rela
xatio
n tig
hter
.
Thi
s is
a m
odel
ing
“tric
k,”
part
of
the
folk
lore
of m
odel
ing.
Slid
e 53
The
res
ultin
g m
odel
1
1 1min
, a
ll
0,
all
,
1 ,
all
,{0
,1}
n
ii
i
jij
ii
j
iji
n
iji
n
ii
ji
j
iji
cy
ax
Qy
i
xy
ij
xj
Qy
a
xy
=
= =
≤
≤≤ =
≥ ∈∑
∑
∑ ∑∑
The
yiis
red
unda
nt b
ut m
akes
th
e co
ntin
uous
rela
xatio
n tig
hter
.
Thi
s is
a m
odel
ing
“tric
k,”
part
of
the
folk
lore
of m
odel
ing.
Con
vent
iona
l mod
elin
g w
isdo
m
wou
ld n
ot u
se th
is c
onst
rain
t, be
caus
e it
is th
e su
m o
f the
firs
t co
nstr
aint
ove
r i.
But
it r
adic
ally
red
uces
sol
utio
n tim
e, b
ecau
se it
gen
erat
es
knap
sack
cut
s.
Thi
s ar
gues
for
a pr
inci
pled
ap
proa
ch to
mod
elin
g.
Slid
e 54
Co
nst
rain
t P
rog
ram
min
g M
od
els
CP
Mod
elin
g S
yste
ms
Glo
bal C
onst
rain
tsE
mpl
oyee
Sch
edul
ing
Slid
e 55CP
Mo
del
ing
Sys
tem
s
•C
omm
erci
al m
odel
ing
syst
ems
with
ded
icat
ed s
olve
rs
•O
PL
Stu
dio
(run
s IL
OG
Sol
ver,
ILO
G S
ched
uler
)
•C
HIP
(ru
ns C
HIP
sol
ver)
•M
osel
(ru
ns X
pres
s-K
alis
)
•M
ozar
t (us
es O
z la
ngua
ge)
•N
on-c
omm
erci
al m
odel
ing
syst
em w
ith d
edic
ated
sol
vers
•E
CLi
PS
e (r
uns
EC
LiP
Se
CP
sol
ver)
Slid
e 56Glo
bal
co
nst
rain
ts
•A
glo
bal
co
nst
rain
tre
pres
ents
a s
et o
f con
stra
ints
with
sp
ecia
l str
uctu
re.
•T
he s
truc
ture
is e
xplo
ited
by f
ilter
ing
alg
orith
ms
in th
e C
P
solv
er.
Slid
e 57
So
me
gen
eral
-pu
rpo
se g
lob
al c
on
stra
ints
Alld
iff
-R
equi
res
that
all
the
liste
d va
riabl
es t
ake
diffe
rent
va
lues
.
Am
on
g-
Bou
nds
the
num
ber
of li
sted
var
iabl
es t
hat t
ake
one
of
the
valu
es in
a li
st.
Car
din
alit
y-
Bou
nds
the
num
ber
of li
sted
var
iabl
es t
hat t
ake
each
of t
he v
alue
s in
a li
st.
Ele
men
t -
Req
uire
s th
at a
giv
en v
aria
ble
take
the
yth
valu
e in
a
list,
whe
re y
is a
n in
tege
r va
riabl
e.
Pat
h-
Req
uire
s th
at a
giv
en g
raph
con
tain
a p
ath
of a
t mos
t a
give
n le
ngth
.
Slid
e 58
So
me
glo
bal
co
nst
rain
ts f
or
sch
edu
ling
Dis
jun
ctiv
e -
Req
uire
s th
at n
o tw
o jo
bs o
verla
p in
tim
e.
Cu
mu
lati
ve-
Lim
its th
e re
sour
ces
cons
umed
by
jobs
run
ning
at
any
one
time.
In
part
icul
ar, i
t can
lim
it th
e nu
mbe
r of
jobs
ru
nnin
g at
any
one
tim
e.
Str
etch
-B
ound
s th
e le
ngth
of a
str
etch
of c
ontig
uous
per
iods
as
sign
ed th
e sa
me
job.
Seq
uen
ce –
A s
et o
f ove
rlapp
ing
amo
ng
con
stra
ints
.
Reg
ula
r–
Gen
eral
izes
str
etch
and
seq
uen
ce.
Dif
fn -
Req
uire
s th
at n
o tw
o bo
xes
in a
set
of m
ultid
imen
sion
al
boxe
s ov
erla
p.
Use
d fo
r sp
ace
or s
pace
-tim
e pa
ckin
g.
Slid
e 59Exa
mp
le:
Em
plo
yee
Sch
edu
ling
•S
ched
ule
four
nur
ses
in 8
-hou
r sh
ifts.
•A n
urse
wor
ks a
t mos
t one
shi
ft a
day,
at l
east
5 d
ays
a w
eek.
•S
ame
sche
dule
eve
ry w
eek.
•N
o sh
ift s
taffe
d by
mor
e th
an tw
o di
ffere
nt n
urse
s in
a w
eek.
•A n
urse
can
not w
ork
diffe
rent
shi
fts o
n tw
o co
nsec
utiv
e da
ys.
•A n
urse
who
wor
ks s
hift
2 or
3 m
ust d
o so
at l
east
two
days
in
a ro
w.
Slid
e 60
Two
way
s to
vie
w th
e p
rob
lem
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Shi
ft 1
AB
AA
AA
A
Shi
ft 2
CC
CB
BB
B
Shi
ft 3
DD
DD
CC
D
Ass
ign
nurs
es to
shi
fts
Sun
Mon
Tue
Wed
Thu
Fri
Sat
Nur
se A
10
11
11
1
Nur
se B
01
02
22
2
Nur
se C
22
20
33
0
Nur
se D
33
33
00
3
Ass
ign
shift
s to
nur
ses
0 =
day
off
Slid
e 61U
se b
oth
form
ulat
ions
in th
e sa
me
mod
el!
Firs
t, as
sign
nur
ses
to s
hifts
.
Let w
sd=
nur
se a
ssig
ned
to s
hift
son
day
d
12
3al
ldiff
(,
,),
all
dd
dw
ww
dT
he v
aria
bles
w1d
, w2d
, w
3dta
ke d
iffer
ent v
alue
s
Tha
t is,
sch
edul
e 3
diffe
rent
nur
ses
on e
ach
day
Slid
e 62
()
12
3al
ldiff
(,
,),
all
card
inal
ity|(
,,
,),
(5,5
,5,5
),(6
,6,6
,6)
dd
dw
ww
wA
BC
d
D
Aoc
curs
at l
east
5 a
nd a
t mos
t 6
times
in th
e ar
ray
w, a
nd s
imila
rly
for
B, C
, D.
Tha
t is,
eac
h nu
rse
wor
ks a
t lea
st
5 an
d at
mos
t 6 d
ays
a w
eek
Use
bo
th fo
rmul
atio
ns in
the
sam
e m
odel
!
Firs
t, as
sign
nur
ses
to s
hifts
.
Let w
sd=
nur
se a
ssig
ned
to s
hift
son
day
d
Slid
e 63
()
()
()
12
3
,Sun
,Sat
alld
iff,
,,
all
card
inal
ity|(
,,
,),
(5,5
,5,5
),(6
,6,6
,6)
nval
ues
,...,
|1,2
, a
ll
dd
d
ss
ww
w
w
d
AB
CD
ww
s
The
var
iabl
es w
s,S
un, …
, ws,
Sat
take
at
leas
t 1 a
nd a
t mos
t 2 d
iffer
ent
valu
es.
Tha
t is,
at l
east
1 a
nd a
t mos
t 2
nurs
es w
ork
any
give
n sh
ift.
Use
bo
th fo
rmul
atio
ns in
the
sam
e m
odel
!
Firs
t, as
sign
nur
ses
to s
hifts
.
Let w
sd=
nur
se a
ssig
ned
to s
hift
son
day
d
Slid
e 64R
emai
ning
con
stra
ints
are
not
eas
ily e
xpre
ssed
in th
is
nota
tion.
So,
ass
ign
shift
s to
nur
ses.
Let y
id=
nur
se a
ssig
ned
to s
hift
son
day
d
()
12
3,
alld
iff,
all
,d
dd
yy
yd
Ass
ign
a di
ffere
nt n
urse
to e
ach
shift
on
each
day
.
Thi
s co
nstr
aint
is r
edun
dant
of
prev
ious
con
stra
ints
, but
re
dund
ant c
onst
rain
ts s
peed
so
lutio
n.
Slid
e 65
()
()
12
3
,Sun
,Sat
alld
iff,
all
stre
tch
,,
|(2,
3),
(2,2
),(6
,6),
, al
l
,,
dd
d
ii
y
Pi
y
yy
dy
…
Eve
ry s
tret
ch o
f 2’s
has
leng
th b
etw
een
2 an
d 6.
Eve
ry s
tret
ch o
f 3’s
has
leng
th b
etw
een
2 an
d 6.
So
a nu
rse
who
wor
ks s
hift
2 or
3 m
ust d
o so
at l
east
tw
o da
ys in
a r
ow.
Rem
aini
ng c
onst
rain
ts a
re n
ot e
asily
exp
ress
ed in
this
no
tatio
n.
So,
ass
ign
shift
s to
nur
ses.
Let y
id=
nur
se a
ssig
ned
to s
hift
son
day
d
Slid
e 66
()
()
12
3
,Sun
,Sat
alld
iff,
all
stre
tch
,,
|(2,
3),
(2,2
),(6
,6),
, al
l
,,
dd
d
ii
y
Pi
y
yy
dy
…
Her
e P
= {
(s,0
),(0
,s)
| s=
1,2
,3}
Whe
neve
r a
stre
tch
of a
’s im
med
iate
ly p
rece
des
a st
retc
h of
b’s
, (a
,b)
mus
t be
one
of th
e pa
irs in
P.
So
a nu
rse
cann
ot s
witc
h sh
ifts
with
out
taki
ng a
t lea
st o
ne d
ay o
ff.
Rem
aini
ng c
onst
rain
ts a
re n
ot e
asily
exp
ress
ed in
this
no
tatio
n.
So,
ass
ign
shift
s to
nur
ses.
Let y
id=
nur
se a
ssig
ned
to s
hift
son
day
d
Slid
e 67N
ow w
e m
ust c
onne
ct th
e w
sdva
riabl
es to
the
y id
varia
bles
.
Use
ch
ann
elin
g c
on
stra
ints
:
, a
ll ,
, a
ll ,
i dd s
d
wy
dy
ii
wd
ss
d
= =
Cha
nnel
ing
cons
trai
nts
incr
ease
pro
paga
tion
and
mak
e th
e pr
oble
m e
asie
r to
sol
ve.
Slid
e 68T
he c
ompl
ete
mod
el is
:
, a
ll ,
, a
ll ,
i dd s
d
wy
dy
ii
wd
ss
d
= =
()
()
()
12
3
,Sun
,Sat
alld
iff,
,,
all
card
inal
ity|(
,,
,),
(5,5
,5,5
),(6
,6,6
,6)
nval
ues
,...,
|1,2
, a
ll
dd
d
ss
ww
w
w
d
AB
CD
ww
s
()
()
12
3
,Sun
,Sat
alld
iff,
all
stre
tch
,,
|(2,
3),
(2,2
),(6
,6),
, al
l
,,
dd
d
ii
y
Pi
y
yy
dy
…
Slid
e 69
Inte
gra
ted
Mo
del
s
Mod
elin
g S
yste
ms
Pro
duct
Con
figur
atio
nM
achi
ne A
ssig
nmen
t and
Sch
edul
ing
Slid
e 70Inte
gra
ted
Mo
del
ing
Sys
tem
s
•C
omm
erci
al m
odel
ing
syst
ems
with
ded
icat
ed s
olve
rs
•O
PL
Stu
dio
(run
s C
PLE
X, I
LOG
Sol
ver/
Sch
edul
er)
•M
osel
(ru
ns X
pres
s-M
P, X
pres
s-K
alis
)
•N
on-c
omm
erci
al m
odel
ing
syst
ems
with
ded
icat
ed s
olve
rs
•E
CLi
PS
e (r
uns
EC
LiP
Se
CP
sol
ver,
Xpr
ess-
MP
)
•S
IMP
L (u
nder
dev
elop
men
t)
Slid
e 71
Thi
s ex
ampl
e co
mbi
nes
MIL
P m
od
elin
g w
ith v
aria
ble
ind
ices
, us
ed in
con
stra
int p
rogr
amm
ing.
•It
can
be s
olve
d by
com
bini
ng M
ILP
and
CP
tech
niqu
es.
Exa
mp
le:
Pro
du
ct C
on
fig
ura
tio
n
Slid
e 72
Mem
ory
Mem
ory
Mem
ory
Mem
ory
Mem
ory
Mem
ory
Pow
ersu
pply
Pow
ersu
pply
Pow
ersu
pply
Pow
ersu
pply
Dis
k dr
ive
Dis
k dr
ive
Dis
k dr
ive
Dis
k dr
ive
Dis
k dr
ive
Cho
ose
wha
t typ
e of
eac
h co
mpo
nent
, and
how
man
y
Per
sona
l com
pute
r
The
pro
blem
Slid
e 73
min
, al
l
, al
l
i
jj
j
ji
ijtik
jj
j
cv
vq
Aj
Lv
Uj
= ≤≤
∑ ∑
Am
ount
of a
ttrib
ute
jpr
oduc
ed
(< 0
if c
onsu
med
):
mem
ory,
hea
t, po
wer
, w
eigh
t, et
c.
Qua
ntity
of
com
pone
nt i
inst
alle
d
Inte
grat
ed m
odel
Am
ount
of a
ttrib
ute
jpr
oduc
ed b
y ty
pe t
iof
com
pone
nt i
Uni
t cos
t of p
rodu
cing
at
trib
ute
j
Slid
e 74
min
, al
l
, al
l
i
jj
j
ji
ijtik
jj
j
cv
vq
Aj
Lv
Uj
= ≤≤
∑ ∑
Inte
grat
ed m
odel
t i is
a v
aria
ble
in
dex
()
1
, al
l
elem
ent
,(,
,,
),,
all
,
ji
i
ii
iji
ijni
vz
j
tq
Aq
Az
ij
=∑
…
Thi
s is
ref
orm
ulat
ed
Slid
e 75
min
, al
l
, al
l
i
jj
j
ji
ijtik
jj
j
cv
vq
Aj
Lv
Uj
= ≤≤
∑ ∑
Inte
grat
ed m
odel
t i is
a v
aria
ble
in
dex
()
1
, al
l
elem
ent
,(),
, al
l ,
,,
i
ji
i
iij
iin
ij
vz
j
tz
qA
qA
ij
=∑
…
Thi
s is
ref
orm
ulat
ed
Set
zieq
ual t
o th
e t ith
item
in th
e re
dlis
t.
Slid
e 76
Mac
hin
e A
ssig
nm
ent
and
Sch
edu
ling
•Ass
ign
jobs
to m
achi
nes
and
sche
dule
the
mac
hine
s as
sign
ed
to e
ach
mac
hine
with
in t
ime
win
dow
s.
•T
he o
bjec
tive
is to
min
imiz
e m
akes
pan
.
•C
ombi
ne M
ILP
and
CP
mod
elin
g
Tim
e la
pse
betw
een
star
t of f
irst j
ob a
nd
end
of la
st jo
b.
Slid
e 77
Mac
hine
Sch
edul
ing
()
min
, al
l , al
l
disj
unct
ive
(),
()
, al
l
j
j
jx
j
jj
jx
j
jj
ijj
M
Ms
pj
rs
dp
j
sx
ip
xi
i
≥+
≤≤
−
==
Sta
rt ti
me
varia
ble
for
job
j
Mak
espa
n
The
mod
el is
Pro
cess
ing
time
of jo
b j
on m
achi
ne x
jM
achi
ne
assi
gned
to jo
b j
Slid
e 78
Mac
hine
Sch
edul
ing
()
min
, al
l , al
l
disj
unct
ive
(),
()
, al
l
j
j
jx
j
jj
jx
j
jj
ijj
M
Ms
pj
rs
dp
j
sx
ip
xi
i
≥+
≤≤
−
==
Rel
ease
tim
e fo
r jo
b j
Tim
e w
indo
ws
The
mod
el is
Dea
dlin
e fo
r jo
b j
Slid
e 79
Mac
hine
Sch
edul
ing
()
min
, al
l , al
l
disj
unct
ive
(),
()
, al
l
j
j
jx
j
jj
jx
j
jj
ijj
M
Ms
pj
rs
dp
j
sx
ip
xi
i
≥+
≤≤
−
==
Sta
rt ti
mes
of
jobs
ass
igne
d to
mac
hine
i
Dis
junc
tive
glob
al
cons
trai
nt r
equi
res
that
Jo
bs d
o no
t ove
rlap
The
mod
el is
Slid
e 80
Mac
hine
Sch
edul
ing
()
min
, al
l , al
l
disj
unct
ive
(),
()
, al
l
j
j
jx
j
jj
jx
j
jj
ijj
M
Ms
pj
rs
dp
j
sx
ip
xi
i
≥+
≤≤
−
==
The
pro
blem
can
be
solv
ed b
y lo
gic-
base
d B
ende
rs d
ecom
posi
tion.
Mas
ter
prob
lem
is
this
plu
s B
ende
rs
cuts
, sol
ved
as a
n M
ILP
Slid
e 81
Mac
hine
Sch
edul
ing
()
min
, al
l , al
l
disj
unct
ive
(),
()
, al
l
j
j
jx
j
jj
jx
j
jj
ijj
M
Ms
pj
rs
dp
j
sx
ip
xi
i
≥+
≤≤
−
==
The
pro
blem
can
be
solv
ed b
y lo
gic-
base
d B
ende
rs d
ecom
posi
tion.
Mas
ter
prob
lem
is
this
plu
s B
ende
rs
cuts
, sol
ved
as a
n M
ILP
Sub
prob
lem
is th
is, s
olve
d by
CP