ILP modeling Exercise 1 â The Steiner Tree Problem
ILP modeling Exercise 1 â The Steiner Tree Problem
ILP modeling Exercise 1 â The Steiner Tree Problem
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Technische Universität Berlin<br />
WiSe 2012<br />
Prof. Andreas Bley<br />
Computational mixed-integer programming<br />
2nd set of programming exercises: <strong>ILP</strong> <strong>modeling</strong><br />
<strong>The</strong> package exercise02.tgz contains instances to test and compare your models and template zpl<br />
files for the exercises.<br />
In this set of exercises, we will consider the <strong>Steiner</strong> tree problem and two more realistic network<br />
design problems stemming from applications in telecommunication network design.<br />
<strong>Exercise</strong> 1 – <strong>The</strong> <strong>Steiner</strong> <strong>Tree</strong> <strong>Problem</strong><br />
Task: Write a zimpl model for each of the following formulations of the <strong>Steiner</strong> tree problem. <strong>The</strong>n<br />
compare how the different formulations perform by solving them in scip.<br />
<strong>The</strong> data parsing part is already implemented in the file sndparser.zpl. Use the sets and functions<br />
provided in sndparser.zpl. A detailed description of these can be found in the beginning of the file<br />
sndparser.zpl. <strong>The</strong> cost l ij for installing edge ij ∈ E is given by the function l(i,j).<br />
Use the parser sndparser.zpl to read the test instances as follows:<br />
zimpl -o MyM<strong>ILP</strong> -D file=Data/instance.txt sndparser.zpl MyModel.zpl<br />
<strong>The</strong> above zimpl command will construct a MyM<strong>ILP</strong>.lp file containing the MIP formulation that can<br />
then be passed to scip to solve the problem.<br />
a) <strong>The</strong> first model to implement is the formulation via undirected cuts. Use the file ucut.zpl as a<br />
template for this implementation and then test it with the test set Data/pdh.txt.<br />
min c T x<br />
s.t. x(δ(S)) ≥ 1<br />
x e ≥ 0<br />
x ∈ Z E<br />
∀ S ⊂ V : ∅ ≠ S ∩ T ≠ T<br />
∀ e ∈ E<br />
(UCUT)<br />
b) Open the file dcut.zpl and model the formulation via directed cuts. <strong>The</strong> parser sndparser.zpl<br />
already constructs a set S1 = {r} containing a single-element r ∈ T as the root node. <strong>The</strong>refore,<br />
you only need to create the set T ′ := T \ {r}. Test your model with Data/pdh.txt and<br />
Data/polska.txt and compare with the first model.<br />
min c T x<br />
s.t. y(δ + (S)) ≥ 1 ∀ S ⊂ V : r ∈ S, S ∩ T ′ ≠ T ′<br />
y (i,j) + y (j,i) ≤ x ij ∀ ij ∈ E<br />
y (i,j) ≥ 0<br />
∀ (i, j) ∈ A<br />
x ij ≥ 0<br />
∀ ij ∈ E<br />
x ∈ Z E<br />
(DCUT)
c) Now implement the (directed) multi-commodity flow formulation using the file mcf.zpl. Solve all<br />
given test instances using this model and check your solutions.<br />
min c T x<br />
s.t.<br />
∑<br />
(i,j)∈δ + (i)<br />
f t (i,j) −<br />
∑<br />
(j,i)∈δ − (i)<br />
f t (j,i)<br />
=<br />
{<br />
1 i = t<br />
0 otherwise<br />
∀ t ∈ T ′ , i ∈ V \ {r}<br />
f s (i,j) + f t (j,i)<br />
≤ x ij ∀ s, t ∈ T ′ , ij ∈ E<br />
f t (i,j) ≥ 0<br />
x ij ≥ 0<br />
x ∈ Z E<br />
∀ t ∈ T ′ , (i, j) ∈ A<br />
∀ ij ∈ E<br />
(MCF)<br />
Optimal solution values<br />
atlanta<br />
cost266<br />
di-yuan<br />
france<br />
nobel-eu<br />
nobel-germany<br />
nobel-us<br />
pdh<br />
polska<br />
4.5550000000e+06<br />
5.6727000000e+05<br />
1.8490000000e+05<br />
1.0608000000e+04<br />
6.9620000000e+04<br />
2.2050000000e+04<br />
5.1290000000e+04<br />
4.8463500000e+05<br />
1.8420000000e+03<br />
<strong>Exercise</strong> 2 – <strong>The</strong> Survivable Network Design <strong>Problem</strong><br />
Task: Formulate the Survivable Network Design <strong>Problem</strong> with edge connectivity requirements 1 and<br />
2. Implement and solve your model using zimpl and scip for the given problem instances.<br />
Formally, the Survivable Network Design <strong>Problem</strong> is given as follows:<br />
{1, 2}-Survivable Network Design <strong>Problem</strong><br />
Given<br />
Solution<br />
Goal<br />
undirected graph (V, E) with edge costs l e for the edges e ∈ E together with the connectivity<br />
requests ρ v ∈ {1, 2}<br />
edge set E ′ ⊆ E such that (V, E) contains min{ρ s , ρ t } edge disjoint (s, t)-paths for each<br />
pair of distinct nodes s, t ∈ V .<br />
minimize the total edge cost, i.e. min e∈E ′ l e<br />
All necessary sets and functions are constructed in sndparser.zpl. Assume that<br />
{<br />
2 v ∈ T<br />
ρ v :=<br />
for all v ∈ V .<br />
1 v ∈ V \ T<br />
<strong>The</strong> cost l ij for installing edge ij is again given by the function l(i,j).<br />
Transform the undirected problem into a problem involving directed paths between the terminals<br />
and use a directed multi-commodity flow formulation similar to that for the <strong>Steiner</strong> tree problem.<br />
<strong>The</strong>re are several variants to do this. A very good model is obtained as follows (you can use snd.zpl<br />
as a template for this exercise):
1. Pick a root node r ∈ T = {v ∈ V | ρ v = 2} (in zimpl, use the set S1 = {r} created by<br />
sndparser.zpl, again) and create a unit-demand commodity from r to each node in V \ {r}.<br />
<strong>The</strong>se commodities form the first commodity set. Add arc-flow variables and flow conservation<br />
constraints for these commodities.<br />
2. Create a second commodity from r to each node in T \ {r}. <strong>The</strong>se commodities form the<br />
second commodity set. Add extra arc-flow variables and flow conservation constraints for these<br />
commodities, too.<br />
3. Add inequalities to ensure that, for each node t ∈ T \ {r}, the two commodities from r to t are<br />
routed along edge disjoint paths.<br />
4. Create binary variables for each edge and inequalities ensuring that an edge is installed whenever<br />
some commodity flows across the corresponding arcs.<br />
You get a stronger (but also larger) formulation by adding certain flows on anti-parallel arcs.<br />
Optimal solution value<br />
atlanta<br />
cost266<br />
di-yuan<br />
france<br />
nobel-eu<br />
nobel-germany<br />
nobel-us<br />
pdh<br />
polska<br />
1.6095000000e+07<br />
1.7801100000e+06<br />
3.5250000000e+05<br />
3.8932000000e+04<br />
1.5270000000e+05<br />
2.2050000000e+04<br />
2.2050000000e+04<br />
1.0468340000e+06<br />
5.2120000000e+03<br />
<strong>Exercise</strong> 3 – <strong>The</strong> Capacitated Network Design <strong>Problem</strong><br />
In this exercise, we consider an undirected version of the Capacitated Network Design <strong>Problem</strong> with<br />
modular edge capacities and edge setup costs given as follows:<br />
Capacitated Network Design <strong>Problem</strong><br />
Given<br />
Solution<br />
Goal<br />
undirected graph G = (V, E) with edge setup costs l e capacity u ek and cost c ek for all<br />
edges e ∈ E and all capacity modules k ∈ K<br />
directed commodities C ⊂ V 2 with demands d st for each (s, t) ∈ C<br />
integers y ek for all e ∈ E and k ∈ K such that the edge capacities x e := ∑ k∈K u eky ek<br />
permit a (fractional) multi-commodity flow routing all commodities,<br />
i.e., the edge capacity x ij is at least as large as the sum of the directed flows on the two<br />
arcs (i, j) and (j, i).<br />
minimize the total edge setup cost plus the total capacity installation cost, i.e.<br />
min ∑ e∈E:x l e>0 e + ∑ e∈Ek∈K c eky ek<br />
Task: Formulate the Capacitated Network Design <strong>Problem</strong> as a mixed-integer linear program. Implement<br />
and solve your model using zimpl and scip for the given problem instances.<br />
All necessary sets and functions are constructed in sndparser.zpl.<br />
To create a correct model, the following steps might be helpful:<br />
1. Add (directed) arc-flow variables and flow conservation constraints for all commodities. Since<br />
theses flows are not going to be aggregated we can interpret every commodity as a unit-demand
commodity.<br />
2. Add inequalities to link the directed flow and the undirected capacity installation variables. If<br />
you used unit-demand commodities as above, you now have to multiply the flow value on each<br />
edge with the corresponding demand and then compare it with the corresponding u ek y ek .<br />
3. Introduce extra binary variables z e for all edges e ∈ E, expressing whether an edge is set up<br />
or not.<br />
<strong>The</strong>se variables can then be used to determine the total edge setup cost.<br />
Some solutions<br />
atlanta<br />
di-yuan<br />
pdh<br />
polska<br />
1.1717500000e+08<br />
2.4304000000e+06<br />
1.2435812000e+07<br />
3.1024000000e+04<br />
<strong>Exercise</strong> 4 – A realistic extension*<br />
Now adapt your formulation of the Capacitated Network Design <strong>Problem</strong> in such a way that the<br />
underlying flow problem no longer permits an arbitrary fractional multi-commodity, but enforces a<br />
single-path confluent flow.<br />
In a single-path confluent flow, flow towards a destination can only travel on one arc out of a node.<br />
So, if flows with different origins and a common destination merged in some intermediate node,<br />
then they can never split again and they must continue along the same path towards their common<br />
destination. For each destination, all flows to this destination must form a tree directed towards this<br />
destination.<br />
Formulate your model using a disaggregated formulation for the confluent flow.<br />
Remark: <strong>The</strong> single-path confluency requirement arises in applications, where the traffic routing is<br />
controlled in an automatic way by (decentralized) routing protocols that, for the sake of simpler<br />
network management, permit only a single outgoing arc towards each destination. Variants of such<br />
protocols are used in telecommunication networks, in postal and logistics networks, and in the freight<br />
car network of Deutsche Bahn, for example.