Optimization Background For Network Design
Optimization Background For Network Design
Network Design
David Tipper
Associate Professor
Department of Information Science
and
Telecommunications
University of Pittsburgh
[email protected]
Slides 5
http://www.sis.pitt.edu/~dtipper/2110.html
Telcom 2110
Telcom 2120Spring
2 2006 2
1
Network Design Tools
• Variety of tools available
– WANDL, VPISystems, OPNET, RSOFT, etc. – trend is to
develop tools for internal use only make money on consulting
Telcom 2110
Telcom 2120Spring
3 2006 3
Optimization Review
• Optimization Techniques
– Seek to find maximum or minimum of a objective function
– Set of unknown decision variables
– Constraints limit the possible values for the variables
• Definition
– “A Mathematical Programming Model is a mathematical
decision model for planning (programming) decisions that
optimize an objective function and satisfy limitations
imposed by mathematical constraints.” **1
**1 T.W. Knowles, Management Science: Building and Using Models, Irwin, 1989.
Telcom 2110
Telcom 2120Spring
4 2006 4
2
Types of Optimization Problems
Telcom 2110
Telcom 2120Spring
5 2006 5
• If Unconstrained
– objective function F(X) is continuous function of x and
x is continuous
– Find MAX/MIN of F(x) by differentiation (set derivative = 0)
– Determine if MAX or MIN by second derivative
– If multi-dimensional – calculate gradient – use numerical gradient
search methods
– Newton's method gives rise to a wide and important class of
algorithms that require computation of the gradient vector
∂φ ∂φ ∂φ
∇φ ( x , y , z ) = xˆ + yˆ + zˆ
∂x ∂y ∂z
Telcom 2110
Telcom 2120Spring
6 2006 6
3
Constrained Optimization
• General Symbolic Model
…
g m ( x1 , x2 K xn ) {≤, ≥, =} bm
Telcom 2110
Telcom 2120Spring
7 2006 7
Mathematical Programming
• Types of Mathematical Programs:
– Linear Programs (LP): the objective and constraint functions
are linear and the decision variables are continuous.
Telcom 2110
Telcom 2120Spring
8 2006 8
4
Linear Programming
• General Symbolic Form
Maximize: c1 x1 + c2 x2 + K cn xn Objective
…
a m1 x1 + a m 2 x 2 + K + a mn x n {≤ , ≥ , =} bm
0 ≤ xj, j = 1, K , n Bounds
Maximize : cT x
Telcom 2110
Telcom 2120Spring
9 2006 9
Linear Programming
• Can be written in matrix formulation
Maximize: cT x Objective
0 ≤ xj ∀j Bounds
Telcom 2110
Telcom 2120Spring
10 2006 10
5
Linear Programming
• General Restrictions
– All decision variables must be nonnegative x ≥ 0.
– Constant terms cannot appear on the LHS of a constraint.
j
Telcom 2110
Telcom 2120Spring
11 2006 11
Formulating LP Problems
• An example**2
– A steel company must decide how to allocate production time on
a rolling mill. The mill takes unfinished slabs of steel as input and
can produce either of two products: bands and coils.
The products come off the mill at different rates and also have
different profit-abilities:
Tons/hour Profit/ton
Bands 200 $25
Coils 140 $30
**2 from, R. Fourer, D. Gay, B. Kernighan, AMPL, Boyd & Fraser, 1993, pp. 2-10.
Telcom 2110
Telcom 2120Spring
12 2006 12
6
Formulating LP Problems
• Example (cont’d)
– The question facing the company is:
If 40 hours of production time are available, how many tons of
bands and coils should be produced to bring in the greatest
total profit?
Telcom 2110
Telcom 2120Spring
13 2006 13
Formulating LP Problems
• Definine the Decision Variables
– XB number of tons of bands produced.
– XC number of tons of coils produced.
Telcom 2110
Telcom 2120Spring
14 2006 14
7
Solving LP Problems
Bands 0 Bands
0
0 2000 4000 6000 8000 0 2000 4000 6000 8000
XB XB
Optimal Solution: XB = 6000, XC = 1400
Profit = 25*6000 + 30*1400
= $192,000
Telcom 2110
Telcom 2120Spring
15 2006 15
Solving LP Problems
• 4 Possible Outcomes
Telcom 2110
Telcom 2120Spring
16 2006 16
8
Solving LP Problems
• In general problem is too complex for graphical solution
• Simplex method
– Efficient algorithm to solve LP problems by performing matrix
operations on the LP Tableau
– Developed by George Dantzig (1947)
– Can be used to solve small LP problems by hand
– Equivalent to checking corner points
• For large problems interior point methods used which
make steps through the middle of the feasible space in
checking corner points.
• Many software packages implement LP
– General math/stats packages: Matlab, MS Excel, Maple, etc.
– Specialized optimization packages : Lindo, AMPL/CPLEX,
Minos, etc.
Telcom 2120 17
Simplex Method
Telcom 2120 18
9
LP Example
• Two types of leather belts: deluxe and regular, each requires
1 sq. yard of leather
• Each week: only 40 sq yard leather & 60 hrs of labor skill
available
• Regular belt: 1 hr labor -> $3 profit
Deluxe belt: 2 hr labor -> $4 profit
• Variable: x1 = # deluxe belts produced/wk
x2 = # regular belts produced/wk
Telcom 2110
Telcom 2120Spring
19 2006 20
Telcom 2110
Telcom 2120Spring
20 2006 1
10
Simplex method for standard Max problem
• Step2: Write down the simplex tableau
– Start with NBV = {x1, x2} and BV = {z, s1, s2}
z x1 x2 s1 s2 rhs BV
1 -4 -3 0 0 0 z=0
0 1 1 1 0 40 s1 = 40
0 2 1 0 1 60 s2 = 60
Telcom 2110
Telcom 2120Spring
21 2006 2
Telcom 2110
Telcom 2120Spring
22 2006 3
11
Simplex method for standard Max problem
• Optimal solution is reached
– No new entering variable is found
– x1 = 20, x2 = 20 with maximum profit at
z = 4(20) + 3(20) = $140 per week
Same Solution as graphical approach
z x1 x2 s1 s2 rhs BV ratio
1 0 0 2 1 140 z = 140
0 0 1 2 -1 20 x2 = 20
0 1 0 -1 1 20 x1 = 20
Telcom 2110
Telcom 2120Spring
23 2006 3
Solving LP problems
• Simplex method
– Easy to use but to solve large problems need to use
computer
• AMPL and CPLEX
– AMPL: modeling language (and software) for designing large
and complex LP/IP problems.
– CPLEX: software package (“solver”) to solve large and
complex LP/IP problems.
Telcom 2110
Telcom 2120Spring
26 2006 17
12
Example: Simplex Algorithm
• Look at the LP problem (slide 14) solved graphically:
Maximize: 25 X B + 30 X C
Telcom 2110
Telcom 2120Spring
27 2006 18
Telcom 2110
Telcom 2120Spring
28 2006 19
13
Matlab Example
• Look at the LP problem (slide 14) solved graphically:
Maximize: 25 X B + 30 X C
Subject to: (1 200 ) X B + (1 140 )X C ≤ 40
0 ≤ X B ≤ 6000
0 ≤ X C ≤ 4000
In Matlab formulate LP problems as >> f = [-25 -30];
>>A = [1/200 1/140; 1 0; 0 1];
Minimize fx >> b = [40 6000 4000];
>> b = b';
s.t. Ax <= b
>> [x,fval]=linprog(f,A,b)
Optimization terminated.
x=
1.0e+003 *
6.0000
1.4000
fval = -1.9200e+005
Telcom 2110
Telcom 2120Spring
29 2006 18
Integer Programming
• Many problems in Network Design involve variables that are
restricted to Integer Values – problems with such constraints are
called Integer Programs
• Consider previous LP Example (slides 12-14)
– Assume that orders for bands and coils are placed (and filled) in
1,000s of pounds only.
– Although feasible region is greatly reduced, problem becomes much
more difficult.
Telcom 2110
Telcom 2120Spring
30 2006 23
14
Integer Programming
Coils
X’C
6
$185K
Telcom 2110
Telcom 2120Spring
31 2006 24
Solving IP Problems
• Branch-and-Bound Procedure
– The solution space consists of a tree of LP subproblems, in which each
integer variable is either fixed or its integrality constraint is “relaxed.”
– The root node of the tree is the LP relaxation of the problem, i.e. all
integer variables are relaxed.
– The relaxation can result in an all integer solution, or a fractional
solution (some decision variables are non-integer).
– If the solution of the relaxation has fractional-valued integer variables,
a fractional variable is selected for branching and two new
subproblems are generated, each with more restrictive bounds on the
branching variable.
– The subproblems can result in an all integer solution, an infeasible
problem or another fractional solution.
– If the solution is fractional, the process is repeated.
– Branches are “fathomed” if the subproblem is infeasible, the objective
value is worse than the current best integer solution or the subproblem
gives an integer solution.
Telcom 2110
Telcom 2120Spring
32 2006 25
15
Solving MIP Problems
• Branch-and-Bound Tree (Example)
SP1:Bounds Solution
0<=XB<=6 Obj. = 192K
0 0<=XC<=4 XB = 6.00
XC = 1.40
1 3
2
SP2:Bounds Solution SP3:Bounds Solution
0<=XB<=6 Obj. = 180K 0<=XB<=6 Obj. = 189K
1 2
0<=XC<=1 XB = 6.00 2<=XC<=4 XB = 5.14
XC = 1.00 4 XC = 2.00
10
9
SP4:Bounds Solution SP7:Bounds Solution
0<=XB<=5 Obj. = 188K 6<=XB<=6 *Infeasible
3 6
2<=XC<=4 XB = 5.00 2<=XC<=4
XC = 2.10
5 7
6 8
SP5:Bounds Solution SP6:Bounds Solution
0<=XB<=5 Obj. = 185K 0<=XB<=5 Obj. = 183K
4 5
2<=XC<=2 XB = 5.00 3<=XC<=4 XB = 3.71
XC = 2.00 XC = 3.00
Telcom 2110
Telcom 2120Spring
33 2006 26
Branch-and-Bound (cont’d)
6 6
XC XC
4 4
0 Bands 0 Bands
0 2 4 6 8 0 2 4 6 8
XB XB
Telcom 2110
Telcom 2120Spring
34 2006 27
16
Branch-and-Bound (cont’d)
6 6
XC XC
4 4
0 Bands 0
0 2 4 6 8 0 2 4 6 8
XB XB
Telcom 2110
Telcom 2120Spring
35 2006 28
Branch-and-Bound (cont’d)
6 6
XC XC
4 4
0 Bands 0
0 2 4 6 8 0 2 4 6 8
XB XB
Telcom 2110
Telcom 2120Spring
36 2006 29
17
Branch-and-Bound (cont’d)
• Subproblem7: 6<=XB<=6
2<=XC<=4
Coils
XC
4
NO Feasible Solution
2
0 Bands
0 2 4 6 8
XB
Telcom 2110
Telcom 2120Spring
37 2006 30
Telcom 2110
Telcom 2120Spring
38 2006 31
18
Algebraic Expression of LP/IP Problems
• Basic Production Model (Revisited)
Original Model Algebraic Model
End
Subject to: ∑ (1 a )X
j∈P
j j ≤b
0 ≤ X j ≤ u j , ∀j ∈ P
Telcom 2110
Telcom 2120Spring
39 2006 32
AMPL model
• Basic AMPL model (revisited) -prod0.mod
set P;
param a {j in P};
param b;
param c {j in P};
param u {j in P};
var X {j in P};
maximize Total_Profit: sum {j in P} c[j] * X[j];
subject to Time: sum {j in P} (1/a[j]) * X[j] <= b;
subject to Limit {j in P}: 0 <= X[j] <= u[j];
Telcom 2110
Telcom 2120Spring
40 2006 33
19
Network Design Optimization
Formulations
• Optimization Based Formulations widely
used as a starting point in network design
tools
• Good Reference is M. Pioro and D. Medhi
book Routing, Flow and Capacity Design in
Communication and Computer Networks
• Consider a couple of simple examples
– Max Flow Assignment (routing problem)
– Telephone Capacity Assignment
Telcom 2120 41
Telcom 2120 42
20
Network Flow LP Formulations (2)
“transportation problem” or “arc-flow” approach
1 x32
x23 x45
x13
3 5
x35
Source: W. D. Grover, ECE 681, UofA, Fall 2004
Telcom 2120 43
Telcom 2120 44
21
Network Flow LP Formulations (4)
“transportation problem” or “arc-flow” approach
max ∑ x1i
Symbolically....
1,i∈E
∑ xij = ∑ xji
i , j∈E i , j∈E
∀i ∈ {N − {1,5}}
Telcom 2120 45
Symbolically....
max ∑
i∈P15
fi
s.t. ∑
i∈P15
fi ⋅ δ ik ≤ sk ∀k ∈ E
fi ≥ 0 ∀i ∈ P15
Where:
E = set of edges that exist (indexed by k)
P 15= set of “eligible” distinct routes between nodes 1 and 5 (source-sink)
sk = spare capacity on edge k
δ ik = 1 if the i th distinct route crosses span k. Zero otherwise
Telcom 2120 46
22
Network Flow LP Formulations (6)
“flow assignment to routes” or “arc-path” approach - example
Identify all distinct routes between source- sink (set P15) ....
f1
2 f4
4 2 4
1
1
f2
3 5
3 5
f3
Telcom 2120 47
f1
20 2 10 f4
4 2 4
1 20 10
2 1 2
5
8 f2 5
3 5 3 5
20 8
f3 20
Telcom 2120 48
23
Network Flow LP Formulations (8)
“flow assignment to routes” or “arc-path” approach - example (2)
f1
20 2 10 f4
4 2
20 10 4
1 1
2 5 2 5
8 f2
3 5 3 5
20 8
f3 20
Telcom 2120 49
executable model.
• Really they just represent our knowledge of the topology and the routes
being considered.
• Implicitly above, we only wrote the flow variables that had non-zero
coefficients.
Telcom 2120 50
24
Sonet/STM Design Problem
Telcom 2120 51
Telcom 2120 52
25