Fo he ollowing mul icommodi y ne wo k: 1--> 2 is equi ed o anspo g1
=400 low uni s o commodi y 1 and 3 --> 4 g2= 400 low uni s o
commodi y 2. ( 0 = pe uni anspo a ion cos ) -->EDIT .da ile
b)
Using he co esponding AMPL model and using sol e Gu obi
sol e he p oblem (i is necessa y i s o edi he pa ame e s ile);
c.1) No join capaci y limi s a links.
c.2) Modi y he AMPL model so ha join capaci y cons a in s en e in o
play. De ine he alue o hese join capaci ies so ha he solu ion ound in
c.1) is no longe easible a leas a a link.
c.3) Fo he solu ion wi h capaci y cons ain s, p in he solu ion and he
dual a iables N o he balance cons ain s and he dual a iable o o he
join capaci y cons ain ha has been added in c.2).
Check ha he ollowing ela ionships hold : Ni= - , and
c)
Asume now ha he e is only a single commodi y in he ne wo k and ha i is
necessa y o anspo 400 & 400 om 1,3 o 2,4 (no capaci y limi s)
d.1) sol e he p oblem using AMPL and compa e he solu ions wi h
hose ob ained in c.1).
a) Sol e he p oblem coded in Mincos .mod wi h da a in Mincos .da using
di e en sol e s: MINOS, Gu obi and Cplex. P in he solu ion ( lows on
links) as well he alues in Node o each o he sol e s. Check he
co espondence be ween he alues in Node and he dual a iables o he
solu ion. Check he complemen a i y be ween educed cos s and solu ion
lows.
d)
Assignmen 0. Using AMPL and he KKT condi ions
No es and ecommenda ions o ollow o In oduc o y Assignmen 0
As ega ds o s ep a) he e alua ion o dual a iables and educed cos s o a simple MinCos
p oblem is equi ed. The example ollows ha o he class no es, summa ized in his pic u e:
In he p e ious example, dual a iables appea calcula ed aking node 6 as oo node (i.e. ha wi h
a 0 dual a iable). I node 4 had been aken as oo node, he dual a iables would ha e been:
When sol ing he p oblem using AMPL wi h Gu obi as sol e :
ampl: model mincos .mod;
ampl: da a mincos .da ;
ampl:
ampl: op ion sol e gu obi;
ampl: sol e;
Gu obi 9.1.1: op imal solu ion; objec i e 73
1 simplex i e a ions
ampl: display Nodo; # dual . o Nodo cons ain s a e displayed
Nodo [*] :=
C1 2
C2 4
C3 5
C4 0
C5 5
C6 -3
;
No ice ha he dual a iables epo ed a e hose in he p e ious igu e, bu changed in sign! This
is SOLVER dependen .
No ice also ha he dual a iables a e hose co esponding o he basic solu ion ( ed links in he
igu e). In o de o know which lows a e basic and which a e non-basic, display he .ss a us su ix:
ampl: display enlace.ss a us;
enlace.ss a us :=
C1 C2 bas # basic a iable
C2 C3 bas
C2 C4 low # non-basic a iable
C2 C5 bas
C2 C6 low
C3 C4 low
C4 C6 low
C5 C4 low
C6 C1 bas
C6 C4 bas
;
AMPL displays hose a iables in he basic se IB wi h he label “bas”. Those in IN appea wi h “low”
Some imes, a e sol ing a p oblem some a iables appea ma ked as “none”. In his case he dual
a iables associa ed o nodes o links ma ked wi h “none” may be no calcula ed by he SOLVER.
Then, p e iously o use dual a iables in any calcula ion:
a) The use mus know whe he o no he SOLVER changes i s sign. Since only di e ences in
dual a iables may be equi ed, which node is aken as oo node is usually no ele an .
b) I mus be known whe he a comple e iden i ica ion o basic and non-basic indexes has
been done by he SOLVER, i.e. no low appea s ma ked wi h .ss a us o “none”
As an exe cise change link (5,4) by i s opposi e (4,5) also wi h a cos o 20 and un again AMPL o
sol ing he p oblem wi h Gu obi. Then, display he dual a iables and he .ss a us o he a iable
enlace and no ice ha he nega i e o dual a iable o node 5 has an e o .
ampl: display Nodo;
Nodo [*] :=
C1 5
C2 7
C3 8
C4 3
C5 0
C6 0
;
The same (al hough
wi h di e en
alues) would occu
wi h CPLEX and MINOS
ampl: display enlace.ss a us;
enlace.ss a us :=
C1 C2 bas
C2 C3 bas
C2 C4 low
C2 C5 none
C2 C6 low
C3 C4 low
C4 C5 none
C4 C6 low
C6 C1 bas
C6 C4 bas
;
As ega ds o s ep b) In o de o display a loa ing poin alue ( o ins ance, he objec i e unc ion
alue Vg) wi h mo e igu es use:
ampl: p in " uncion obje i o =% n",Vg;
uncion obje i o =1232.000000
As ega ds o s ep c) I is expec ed ha imposing a capaci y limi a ion on one o mo e links, he
e ou ing o lows is o ced so ha he objec i e unc ion mus necessa ily inc ease. I may happen
howe e ha despi e he e ou ing, he objec i e unc ion alue does no dec ease, bu emains
he same. (In o de o make su e ha he objec i e unc ion alue changes, i is be e o use he
‘p in ’ command as shown in o de o un eil small changes ha would o he wise, emain hidden
wi h he ‘display’ command).
I he objec i e unc ion does no dec ease, e en hough he uppe bounds ha e been s eng hened,
hen he dual a iable o he co esponding uppe bound cons ain is ze o.
Al hough i has no been s a ed in he cou se, i is known ha he dual a iables o a cons ain o
he ype x <= u1 ha e a dual a iable y1 o he alue u1 o he igh hand side gi en by:
y1= - lim u2 u1 ( (u2) – (u1))/(u2-u1)
being (u1) he objec i e unc ion alue o he op imiza ion p oblem when he igh hand side o
he cons ain is u1.
Example. Assume ha in he Mincm2.mod model he ollowing uppe bound cons ain s on lows
ha e been added:
subjec o capac{(i,j) in links}: [i,j] <= gamma[i,j];
and ha :
a) bounds 100 on links (5,6) and (8,6) ha e been added (i can be shown ha hey a e e ec i e
and ha e ou ing akes place). Check ha objec i e unc ion is 1232, jus as when no uppe
bounds we e added.
b) a bound o 100 is added on link (5,9) ins ead. Now objec i e unc ion inc eases o 1412.
Displaying he dual a iables he ollowing is ob ained:
Gu obi 9.1.1: op imal solu ion; objec i e 1232
6 simplex i e a ions
ampl: p in " uncion obje i o =% n",Vg;
uncion obje i o =1232.000000
ampl: display capac;
capac :=
1 5 0
3 8 0
5 6 0
5 8 0
5 9 0
6 7 0
7 2 0
7 9 0
8 5 0
8 6 0
9 4 0
9 7 0
;
CASE A)
ampl: display capac;
capac :=
1 5 0
3 8 0
5 6 0
5 8 0
5 9 -0.6 #(No ice ha (1412-1232)/300 = 0.6 )
6 7 0
7 2 0
7 9 0
8 5 0
8 6 0
9 4 0
9 7 0
;
CASE B)
No ice ha dual a iables a e gi en
changed in sign !!
Assignmen 1. In oduc ion. Ne wo k Design.
Conside he p oblem consis ing in deciding which links in a anspo a ion o in a da a communica-
ions ne wo k a e necessa y by balancing in es men cos s and educ ions in exploi a ion cos s. Assume
ha ini ially he ne wo k p esen es a con igu a ion gi en by G′= (N, A′) and ha he e exis s he pos-
sibili y o inc easing he numbe o ne wo k links aking he candida e links om a p e-speci ied se ˆ
A,
so ha he inal ne wo k may become G= (N, A) wi h A=A′∪ˆ
A. The ques ion is hen which links
in ˆ
Aa e sui able o be added so ha he o al cos (in es men +exploi a ion) is he minimum possible.
The cos will be made up by wo componen s:
a) on he one hand, adding each new link a∈ˆ
Ap esen s a ix cos a(pu chase+ins ala ion).
b) when in se ice, a link a∈ˆ
Awill ha e a cos pe each uni o low c ossing ha link du ing a gi en
amo iza ion pe iod. Assume is addi ion, ha hese cos pe uni depend on he s a ing o igin (o igin)
o he ip.
In his way, i Kdeno es he se o o igins in he ne wo k, he cos h oughou he amo iza ion pe iod
can be o mula ed as:
o al cos =∑
ℓ∈K∑
a∈A
cℓ
axℓ
a+∑
a∈ˆ
A
aya
being ya= 1 i link a∈ˆ
Ais added o he ne wo k and 0 o he wise.
The p oblem will be now o mula ed using ma ix no a ion.
Le B he node-link incidence ma ix o he ne wo k, xℓ he ec o o lows o igina ing a ℓ∈K.
Assume ha gℓis he o al low ou going om o igin ℓ∈Kand ha i D(ℓ) is he se o des ina ions
co esponding o o igin ℓ, hen gℓ,j is he low a i ing a j∈D(ℓ), in such a way ha :
gℓ=∑
j∈D(ℓ)
gℓ,j
Le ec o ℓha e so many componen s as nodes in he ne wo k. Componen ℓ
ico esponding o
node i∈Nis:
ℓ
i=−gℓ,i i i=ℓi ℓ
i=gℓi node iis p ecisely he o igin ℓ.
Then xℓobey o he ollowing ela ionships:
Bxℓ= ℓ, xℓ≥0
(See a comple e example in he ending page).
The p oblem o ne wo k design can be o mula ed :
Min x,y ∑ℓ∈Kcℓ⊤xℓ+ ⊤y
(A)Bxℓ= ℓ, ℓ ∈K
(B)xℓ
a≤ρ ya, ℓ ∈K, a ∈ˆ
A
(C)xℓ≥0
y∈ {0,1}|ˆ
A|
(1)
and in scala no a ion:
Min x,y ∑ℓ∈K∑a∈Acℓ
axℓ
a+∑a∈ˆ
A aya
∑ ∈I(i)xℓ
,i −∑s∈E(i)xℓ
i,s = ℓ
i, i ∈N, ℓ ∈K
xℓ
a≤ρ ya, a ∈ˆ
A, ℓ ∈K
xℓ
a≥0, a ∈A, ℓ ∈K
ya∈ {0,1}, a ∈ˆ
A
ASSIGNMENT 1. The ne wo k design and lee dimensioning p oblem
The ollowing design p oblem on a mul icommodi y ne wo k low p oblem mus be sol ed.
m´ın
x,w,N,y α(gN + >y) + (1 −α)X
`∈{O,D}
c`>x`(1)
s. . :Bx`=p`, ` ∈ {O, D}(2)
x`≥0 (3)
Bw = 0 (w≥0) (4)
X
`∈{O,D}
x` ≤ Kw(5)
>w≤N(6)
X
`∈{O,D}
x`
i,j ≤Myi,j,(i, j)∈ˆ
A(7)
wi,j ≤Myi,j,(i, j)∈ˆ
A(8)
yi,j ∈ {0,1}, N ∈Z+(9)
The p oblem consis s in inding which o he links (i, j) ∈ Aˆ mus be buil and how many ehicles mus be
pu chased (o en ed) in o de o minimize a gi en objec i e unc ion. Below a sample ne wo k is shown whe e
g aphically, he se o links in Aˆ appea s in ed. Node O will play he ole o o igin o lows o p oduc s o ype 1
and node D will play he ole o des ina ion o p oduc s o ype 2. Nodes in double colo ( ed-blue) will play he ole
o des ina ions o p oduc 1 (20 uni s o low o p oduc 1 mus be deli e ed a each ed-blue node) and o igin o
p oduc 2 (20 uni s o low o p oduc 2 o igina e a each ed-blue node).
Each s uden will ha e i s own ins ance in a g aphic ile speci ying he alues o pa ame e s and c(in es men
and cos s pe link and anspo a ion cos o uni o p oduc low. Fo simplici y, conside ha bo h p oduc ypes
ha e he sqame anspo a ion cos : cO
ij =cD
ij ). Each link has a a el ime gi en by ij = 750((xi−xj)2+(yi−yj)2)1
2.
Conside anspo a ion ehicles wi h a uni cos ha keep his ela ionship wi h in es men cos s:
g= 0,1×m´ın
(i,j)∈ˆ
A
{ ij}
1
1. Implemen i n he AMPL model p o ided (ne des.mod) he app op ia e addi ional cons ain s, a iables and
pa ame e s i n o de o un he model. Check you . da ile acco dingly o you ne wo k.
2. Sol e he p oblem when no addi ional link is added o he ne wo k (i.e., y = 0) and epo he solu ion.
3. Sol e he p oblem when all he candida e links ha e been added o he ne wo k and epo he solu ion.
4. Sol e i ni ially he p oblem as o mula ed p e iously by simply using he ne des.mod ile (comple e i
p ope ly) and epo he solu ion.
5. A ec bo h e ms o he objec i e unc ion (in es men s, exploi a ion cos s) by a pa ame e α, 0 ≤ α ≤ 1.
Ca y ou a mu iobjec i e analysis o he p oblem by ob aining he co esponding Pa e o op imali y on ie .
- Ob ain he ade-o able o bo h objec i e unc ions
- Plo he Pa e o op imal on ie o 30 poin s o he a pa ame e .
6. Conside he case wi h y = 1 and lea e he decision a iables ou o he objec i e unc ion
- Repo o he alues a = 0 and a = 1, he lows o emp y ehicles unning on he ne wo k l inks.
(Se a sui able alue o anspo a ion ehicles capaci y K)
2
ASSIGNMENT 2. Op imiza ion Models o T anspo (MOT)
Implemen he diagonaliza ion me hod o he ne wo k ha will be indica ed o you (NET 1, 2 o
3). Use he iles .mod and . un con ained in he ile asass.zip and edi hem con enien ly adding
he co esponding de ini ions o addi ional a iables, pa ame e s e c. i so equi ed
To illus a e he da a s uc u es ollowing ne wo k example will be p o ided wi h g1= g1,2 =400
ia ges, g2=g3,4= 400 ips.
In he a cs o he ne wo k he ollowing unc ion VDF will apply:
−
+= ∑∈),(),( ,
,
,, 1)(
jiPRIOnm nm
ji
jiji
c
d
α
whe e PRIO (i, j) is he se o a cs ha ha e p io i y o e he (i, j), α = 30 c = 1000.
A each node wi h a leas one inceiden a c (i, j), choose by you sel es he a se PRIO(i, j)
ha ha e p io i y o e he (i, j), wi h
0 <| PRIO (i, j) | <3. Sui ably al e he pa ame e s c and α so ha , a leas 5 i e a ions a e
made by he me hod o diagonaliza ion.
In he epo , display o each i e a ion a) he i e a ion numbe , b) he ela i e gap alue o
he cu en i e a ion a (k gi en by: - s( (k)T(u(k - (k )/ s( (k)T (k, whe e u(k a e he link lows
ob ained by loading he o-d ma ix on he sho es pa hs o each o-d pai wi h cos s on he
ne wo k links gi en by he link-cos ec o s( (k).
Repo also he solu ion lows a he inal i e a ion and upload in ATENEA he AMPL iles
(. un, .mod, .da ) used in he exe cise.
Diagonaliza ion me hod:
NET 4
O ígens
Des inacions
2
3
4
5
1
100
300
50
100
6
150
100
600
200
2
8
1
7
12
6
9
3
10
4
11
5
15
14
13
NET 5
O ígens
Des inacions
5
6
7
8
2
400
1000
600
2500
3
-
200
0
150
1
9
6
10
13
14
21
22
5
8
7
2
4
11
17
18
12
15
16
20
19
3
NET 6
O ígens
Des inacions
5
6
7
8
2
400
700
350
25
3
-
200
4000
150
1
9
6
10
13
14
21
22
5
8
7
2
4
11
17
18
12
15
16
20
19
3
NET 7
O ígens
Des inacions
2
3
4
5
1
190
-
500
100
6
150
400
-
200
2
8
1
7
12
6
9
3
10
4
11
5
15
14
13
NET 8
O ígens
Des inacions
3
4
1
800
350
2
620
350
1
5
6
12
2
7
3
10
9
8
11
13
4
NET 9
O ígens
Des inacions
3
4
1
480
1250
2
1600
900
1
5
6
12
2
7
3
10
9
8
11
13
4
NET 10
O ígens
Des inacions
3
4
1
325
1274
2
617
1630
1
5
6
12
2
7
3
10
9
8
11
13
4
ASSIGNMENT 3. Pigou axes on ma ke s
The ounda ion o ne wo k analysis om he poin o iew o
spa ial ma ke equilib ium can be ound in he cen e o i ual
cou ses and semina s o supe ne s:
h p://supe ne .isenbe g.umass.edu/
Goal p og amming can be used o o mula e spa ial ma ke
equilib ium p oblems in which he e is an ex e nal
in e en ion (usually an adminis a ion) o es ablish subsidies
o o he wise, p oduc ion axes on ce ain i ms so ha his
p oduc ion may i , as much as possible, o some gi en
and con enien
quan i ies ɵ, which a e conside ed as goals o achie e.
The aim is ha , in he e en ha a p oduc gene a es "nega i e
ex e nali ies", a con ibu ion migh be payed by he i m ( axes
on p oduc ion), which is ixed by he adminis a ion o
alle ia e he e ec s o hese ex e nali ies. Typical examples
a e axes on alcoholic be e ages. Then, hese axes a ec he
inal p ice o he consume s, esul ing in lowe consump ion.
Equally, he same policy may be applied in he case o
ac i i ies ha gene a e pollu an s o g eenhouse gases e c.
This is known as Pigou’s e ec .
Con e sely, in he case o bene icial p oduc s, i companies can
no p oduce su icien quan i ies a a p ice a o dable enough,
hen he p oduc ion subsidies help he p oduce s o b ing in he
ma ke s la ge quan i ies o p oduc a lowe p ices, hus
encou aging consump ion.
The model o mula ed in he nex page is an ex ension o he
spa ial ma ke equilib ium model and ep oduces Pigou’s e ec .
In he model, now weigh s Mi o Ni appea , as ixed cos s o
low a iables σ+ and σ- . These σ+, σ- ep esen he amoun s o
excess/lack o p oduc ion as ega ds o objec i e ɵi. All o he
a iables ha e he same meaning ha in he case o elas ic
demand model al eady desc ibed. No ice ha he 0 node now
ecei es an injec ion ha balances he o al lows on he
ne wo k. Usually he di e ence will be posi i e as he sum o
uppe bounds on consump ion will exceed he sum o he
p oduc ion a ge s.
Remembe ha in he ma ke equilib ium model, he di e ence
be ween mul iplie s co esponding o ma ke nodes and he sou ce
node 0 has he physical meaning o minimum selling p ices a
ha ma ke s (Accumula ed p oduc ion + anspo ). In his case,
he di e ence be ween mul iplie s o addi ional nodes and he
o igin o 0 node has he meaning o inc ease / dec ease o he
p oduc ion cos caused by he ax / subsidy espec i ely. I νi
is his inc ease / dec ease o cos o p oduc ion a ac o y i,
hen i is e i ied ha : - Ni ≤ νi ≤ Mi, being Ni, Mi weigh s
on a iables σ+ and σ- in he objec i e unc ion. These weigh s
mus be se so ha goals ɵi a e app oxima ely achie ed.
The spa ial ma ke ’s equilib ium p oblem wi h
axes/subsidies
Tasks in he assignmen
An AMPL model ha has been p o ided o you ep oduces he
p oblem o spa ial p ice equilib ium o ma ke s wi h elas ic
demand, so a discussed in class o heo y and is desc ibed in
he ollowing slides. The da a ile co esponds wi h wo cen es
o p oduc ion and h ee ma ke s.
0) Load in he AMPL sys em he model and he da a (in .da ile)
ha has been p o ided o you and check ha he model execu es
p ope ly. Repo his solu ion ( low a iables, objec i e
unc ion alue and inal p ices a ma ke s).
1) Add one mo e ma ke o he ile o da a and ano he
p oduc ion cen e , upda ing acco dingly he se s MERC, ARCTR,
ARCH_EXC and he iles o pa ame e s, CTRANS, a, b, al a, be a,
d o al, dmax. Repo his solu ion ( low a iables, objec i e
unc ion alue and inal p ices a ma ke s).
2) Load he new se o da a and esol e he p oblem. Repo i s
solu ion, desc ibing which cen es sell o which ma ke s and he
p ices a he ma ke s.
3) Add a limi a ion o capaci y in some link xij co esponding
o a anspo a ion channel ac i ely used o eed a ma ke .
(upda ing he .mod and .da acco dingly). Check ha he
limi a ion o capaci y ac ually will be ac i e aking in o
accoun he solu ion gi en in s ep 2)
4) Elimina e any uppe bound on he lows on he model’s
de ini ion se in p e ious s ep 3). Modi y con enien ly he AMPL
iles p o ided o you o ep oducing he ma ke equilib ium
model in o de o ep oduce he axes / subsidies model on he
p oduc ion desc ibed p e iously.
Fix goal alues o p oduc ion ɵi di e en om he ones ob ained
o he elas ic demand ma ke equilib ium in s ep 2). Then y
o sol e he model wi h di e en alues o he weigh s Ni, Mi
and epo he solu ions ob ained ( lows and inal p ices a
ma ke s)
As a checking o he p ope unc ioning o he model, an example
wi h h ee p oduc ion cen e s o i e consump ion cen e s will
be sol ed (se by you sel he equi ed pa ame e alues). I is
ecommended o p ope ly expand he da a se a ached o he case
ma ke equilib ium wi h inelas ic demand. In each case he
ollowing mus be epo ed:
-Flow solu ion on he links o he model, he alue o he cos
unc ions and inal p ices a ma ke s.
-Ex a p oduc ions σ+ and σ- due o Subsidies/ axes ( a iables
νi) and subsidies/ axes νi
-P ices o p oduc s in he ma ke s and p oduc ion cos s.
4/ 9
Single Depo Vehicle Scheduling
Each se ice o a line is a ask o be pe o med. In he g aph o asks, a
ask will be a link (i, j)
σi, σj=scheduled s a ing and ending clock ime o he ask (i, j)
θi=a a iable o ac ual clock ime o node ion he g aph o asks.
A ole ance may be ixed o accommoda e scheduled ime σiand θi:
σi−≤θi≤σi+
τij = ime equi ed o ca y ou ask (i, j). I can be a ixed pa ame e
o a a iable subjec o uppe and lowe bounds: τij ≤τij ≤ˆτij,
= numbe o ehicles (buses)
Gi en he se o scheduled imes σj, only asks complying wi h he
consis ency condi ion: ˆτij ≤σj−σi−2,j6= 0, make sense o exis in
he g aph o asks.
5/ 9
Single Depo Vehicle Scheduling and ecou se cons ain s
- Typically, a amily o ecou se cons ain s will apply o he clock ime
a iables θja nodes j6= 0 in he g aph o asks.
- Assuming unlimi ed au onomy o he buses, he solu ion would be made
up by sub ou s, each one o hem o each bus.
- I au onomy o he uni s is limi ed, because o uel, ba e y, d i ing ime
o o he eason, each o hese easons gi es ise o a new amily o
ecou se cons ain s. The cha ging poin will be always node 0.
- The cha ging ime, when non-negligible, will added o he ip ime o
asks (0, i)
- Assume Ba e yT ime as he maximum au onomy ime o elec ical
buses. Then, new a iables γja e needed.
-γj=ba e y ime consumed by he uni when eaching node j. No ice
ha in gene al γj6=σj
- Now lee size ≤ =numbe o o al ound ips made by bus uni s o
he depo (node 0).
6/ 9
Subsequences o asks wi h ecou se cons ain s
Min
x, ,θ,τ,γ X
(i,j)∈A
cijxij +ρ
X
j∈E[i]
xij =X
j∈I[i]
xji i= 0,1,2, ...n
X
j∈E[0]
x0j≤ , X
j∈E[i]
xij = 1 i= 1,2, ...n
RC.1θj≥θi+τij −M(1 −xij),(i, j)∈A, j 6= 0
σj−≤θj≤σj+, j 6= 0,
τij ≤τij ≤ˆτij,(i, j)∈A
θ0= 0,
RC.2γj≥γi+τij −M(1 −xij),(i, j)∈A, j 6= 0
γk+τk0≤Ba e yT ime −ε, (k, 0) ∈A
γ0= 0, xij ∈ {0,1}
7/ 9
Single Depo Vehicle + D i e Scheduling. Fo mula ion as IP
D i e s can only be on du y a maximum o ˆ
θminu es on du y.
G= (N, A)g aph o buses; GD= (ND, AD)g aph o d i e s.
Two Cases:
1D i e eplacemen can ake place only a he end o he line
se ice.
2D i es eplamen can ake place a any bus s op.
-τij = ij +dj−ai≥0,∀(i, j)∈A
8/ 9
Single Depo Vehicle + D i e Scheduling. Fo mula ion as IP
MinxX
(i,j)∈A
cijxij +X
i∈N
c0ix0i+X
(i,j)∈AD
γijyij +X
i∈ND
γ0iy0i
X
i∈N
x0i≤ X
i∈ND
y0i≤sd
X
j∈E[i]
xij =X
j∈I[i]
xji, i ∈NX
j∈ED[i]
yij =X
j∈ID[i]
yji, i ∈ND
X
j∈E[i]
xij = 1, i ∈NX
j∈ED[i]
yij = 1 i∈ND
θj≥θi+τij +M(1 −yij), j 6= 0,∀(i, j)∈AD, θ0= 0
xij ≤yij,∀(i, j)∈AD∩A, i, j, 6= 0
0≤θj≤ˆ
θ, j ∈ND
xij, yij ∈ {0,1}
9/ 9
Mul iple Depo Vehicle Scheduling. Fo mula ion as IP
Each depo has i s own g aph Gk= (Nk, Ak)
Nk=N∪ {n+k},
Ak=A∪ {{n+k} × N}∪{N× {n+k}}
MinxX
k
X
(i,j)∈AN
cijxk
ij +X
k
X
i∈Nk
c0ixk
0i
X
j∈N
xk
n+k,j ≤ kk∈K
X
i∈Nk
xk
ij =X
i∈Nk
xk
ji 0≤i≤n
X
k
X
j∈Nk
xk
ij = 1 i∈N
xk
ij ∈ {0,1}
I cos s cn+k,j =cn+k0,j,∀k, k0, hen he p oblem is polynomial and
educes o a single commodi y ne wo k low.
As be o e, aj< di+ ij −→ xk
ij = 0
Assignmen 4. Case S udy conce ning ansi models
1) Sol ea ansi assignmen p oblem o he ollowing ne wo k:
P o . Es e e Codina
Example:
1234
amin
7 min
b min
4 min 4 min
Line F equency (unconges ed): X each hou
Line F equency (unconges ed): Y each hou
Line F equency (unconges ed): Z each hou
Assumeademanduni o mly dis ibu ed on ime:
e*1000 ips om1 o4ande*400 ips om2 o4.
Values o will be X=6s/h, Y=4s/h,Z=6s/h,a=24min,b=5min. e is an augmen ing ac o o he
demand, ini ially aken as e=1, al hough he s uden may change i in case o di icul ies.
1) W i e a epo in which you show he solu ion o he p e ious p oblem by unning he AMPL
ma e ial p o ided ( ass.mod) showing:
a) he objec i e unc ion alue, b) link lows pe des ina ion and o al link lows, c) he alues o he w
a iables in he Spiess' LP model, d) he o-d ip imes on you ne wo k
2) Sol e o he lines p e iously speci ied, a ehicle scheduling p oblem o e a ime ho izon o H=3
hou s. Assume ha elec ical buses will be used wi h an au onomy o h=2 hou s and a cons an
echa ging ime o =15min and ha uni s always echa ge on depo i hey e u n o i .
3) Repo (<=15 pages) :
a) The code de eloped o implemen ing he scheduling model.
b) Acco dingly o he equencies speci ied o you case, se he di e en se ices ha ha e o be un
on each line, along wi h i s s a ing ime, ending ime and possible connec ions be ween se ices
acco dingly o he e u ning imes. These will be assumed (in min) 4-->1 = 30, 4-->2 =25, 3-->1 =
15, 3-->2 = 15min in all cases.
c) The solu ions ob ained speci ying: b.1) he o al numbe o buses needed o ca y ou all he
se ices. b.2) he se ices assigned o each bus.
d) Assuming ha buses can ha e a capaci y o 30, 45, 60, 75 o 100 passenge s choose he
app op ia e bus capaci y.
1
A wo ked example o he Spiess' Algo i hm
(25, ∞)
(7, ∞)(6,∞)
(4, ∞)(4, ∞)
(0,1/6)
(0,1/6) (0, ∞)
(0, ∞)(0,1/6)
(0,1/15)
1234
(0, ∞)
(10, ∞)
(0, 1/3)
Headway=12min; a .wai ing ime=6 min = 1/10 h
e . eq=1/6 min-1 10 ides each ou
Headway=12min; a .wai ing ime=6 min = 1/10 h
e . eq=1/6 min-1 10 ides each ou
Headway=30min; a .wai ing ime=15 min = 1/4 h
e . eq=1/15 min-1 4 ides each ou
Headway=6min; a .wai ing ime=3 min = 1/20 h
e . eq=1/3 min-1 20 ides each ou
2
Example
=0
u=∞
=0
u=∞
=0
u=∞
=0
u=∞
=0
u=∞
(25,1/6)
(10,1/3)
(0,1/6)
(0,∞)(0,1/15)(0,∞)
=0
u= 0
H. Spiess and M. Flo ian, "Op imal s a egies: a new assignmen model o ansi ne wo ks", T ans-
po a ion Resea ch Pa B 23 (2) 83-102 (1989) S
Ā
A (SUĀ)
S ep 0
3
Example
=0
u=∞
=0
u=∞
=∞
u=4
=0
u=∞
=0
u=∞
(25,1/6)
(0,1/6)
(0,∞)(0,1/15)(0,∞)
=0
u= 0
2
(10,1/3)
S
Ā
A (SUĀ)
S ep 1
10
Example
=0
u=∞
= ∞
u= 35/2
=0
u=4
=7/30
u=19’07
=1/15
u=19
(25,1/6)
(0,1/6)
(0,∞)(0,1/15)(0,∞)
=0
u= 0
(10,1/3)
=2/5
u=23/2
=1/15
u=23
S
Ā
A (SUĀ)
S ep 8 (Null S ep)
11
Example
=1/6
u=61/2
= ∞
u= 35/2
=∞
u=4
=7/30
u=19’07
=1/15
u=19
(25,1/6)
(0,1/6)
(0,∞)(0,1/15)(0,∞)
=0
u= 0
(10,1/3)
=2/5
u=23/2
=1/15
u=23
=0
u=∞
S
Ā
A (SUĀ)
S ep 9
12
Example
=1/3
u=111/4
= ∞
u= 35/2
=∞
u=4
=7/30
u=19’07
=1/15
u=19
(25,1/6)
(0,1/6)
(0,∞)(0,1/15)(0,∞)
=0
u= 0
(10,1/3)
=2/5
u=23/2
=1/15
u=23
=0
u=∞
S
Ā
A (SUĀ)
S ep 10
13
Flows o he op imal s a egy
• Line 1
• Line 2
• Line 3
• Line 4
Op imal s a egy - Expec ed a el ime 27.75 min
V=.5
V=.5
V=0
V=.42
V=.5
V=.5