EE 681 Fall 2000 Lecture 5

Download Report

Transcript EE 681 Fall 2000 Lecture 5

E E 681 - Module 6
Lp_solve example, LP tactics, “Network
reliability”, Min cost network flow, multicommodity max flow, more on combinatorial
optimization...
W. D. Grover
TRLabs & University of Alberta
© Wayne D. Grover 2002, 2003
Revisit mesh SCP problem
 s

Minimize  C j  s j 
 j 1

Pi
S.t.
f
p 1
p
i
 wi
 Pi p

s j  d  f p 
i, j
i 


p
1


Min sum of spare capacity
i  1,2,...,S.
(i, j )  1,2,...,S.
Restoration flows for each failure
= failed working capacity
i j
Restoration flows must be feasible
under spare capacity
How would this be expressed as an lp_solve model... ?
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
2
Sample network for example of mesh “SCP”
7
A
4
B
C
8
10
7
E
2
F
G
6
E E 681 - Module 6
•here, spans all have equal
length or cost
•span working capacity
quantities are shown
4
12
•SCP = spare capacity
placement
Z
9
© Wayne D. Grover 2002, 2003
•Problem is to place spare
capacity for 100%
restorability via span
restoration.
3
Sample network for example of mesh “SCP”
7
A
4
B
• as a first step the
“eligible restoration routes”
for each failure are
identified.
C
8
10
7
E
• For example, three
distinct eligible routes for
restoration of span A-B
under 4 hops might be as
shown…(examples only)
2
4
12
F
G
6
Z
9
Flow variables defined for A-B as a failure span
f1
f2
f3
Illustration explaining the first “restorability” constraint to follow...
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
4
Lp_solve example for mesh SCP
/* Objective function */
min: Sab+Sbe+Seg+Sag+Saf+Sgf+Sbc+Scz+Sez+Sfz;
/* The sum of all the flows on the different routes for restoration */
/* of span i must be greater or equal to wi */
f1 + f2 + f3 >= 7;
f4 + f5 + f6 + f7 >= 8;
f8 + f9 + f10 + f11 >= 12;
f12 + f13 + f14 >= 5;
f15 + f16 + f17 + f18 >= 10;
f19 + f20 >= 6;
f21 + f22 >= 4;
f23 + f24 >= 6;
f25 + f26 + f27 + f28 >= 4;
f29 + f30 + f31 + f32 >= 9;
E E 681 - Module 6
/* span A-B */ (see prior slide for this one example)
/* span B-E */
/* span E-G */
One line per span failure
/* span A-G */
The details come from the route
/* span A-F */
identified for restoration,
/* span G-F */
and the associated
/* span B-C */
flow variable for defined for
/* span C-Z */
each route
/* span E-Z */
/* span F-Z */
© Wayne D. Grover 2002, 2003
5
Lp_solve example for mesh SCP
/* The spare capacity on each span must be >= to the sum of the flows
/* on routes that cross this span for every failure scenario */
/* Span A-B */
Sab - f4 - f5 - f6 >= 0;
Sab - f8 - f9 >= 0;
Sab - f14 >= 0;
Sab - f17 - f18 >= 0;
Sab - f22 >= 0;
Sab - f24 >= 0;
Sab - f26 >= 0;
Sab - f31 - f32 >= 0;
/* Span B-E */
Sbe - f1 - f2 >= 0;
Sbe - f8 - f9 >= 0;
Sbe - f14 >= 0;
/* failure of B-E */
The exact definition of eligible
/* failure of E-G */ restoration routes and corresponding
/* failure of A-G */
flow variables (not shown)
/* failure of A-F*/
is needed to
/* failure of B-C */
produce this level of detail.
/* failure of C-Z */
/* failure of E-Z */
/* failure of F-Z */ This shows an example of the logical
form that is taken
/* failure of A-B */
/* failure of E-G */
/* failure of A-G */
....etc... (produces S sets of (S-1) additional constraints)
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
6
Illustration: explaining the first spare-capacity generating
constraint
/* Span A-B */
Sab - f4 - f5 - f6 >= 0;
/* failure of B-E */
…….
7
A
4
B
f4
f1
8
10
7
f5
E
2
f6
4
12
6
f3
f2
F
G
• as a first step the
“eligible restoration routes”
for each failure are
identified.
C
• For example, three
distinct eligible routes for
restoration of span A-B
under 4 hops might be as
shown…(examples only)
Z
9
F1, f2, f3 do not cross span A-B when B-E failure is considered
f4, f5, f6 do cross span A-B when B-E failure is considered
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
7
Tips on formulating LP / IP’s
• Mutual exclusion:
- e.g. Each working demand flow may have only one route
- use a “radio button” constraint:
n
d i  1
i 1
- where
d i {1,0}
is a decision variable to use route i or not.
• Peak minimizing:
- e.g. Minimize the worst case “oversubscription” on all spans j
over all failures, i
- cannot write min { max {function}} in an LP / IP
- can write :
min Z
....
Z - zij >= 0 for every i,j
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
8
Bi-objective LP / IP’s
• Sometimes our notion of optimality depends on more than one criterion
(with different units or measures)
- can form a two term objective function
- “blended” by some weighting factor
e.g.:
min { Z1  (1   ) Z 2}
perhaps: (Z1 ~ capacity Z2~ restoration paths length)
(Z1 ~ cost
Z2~ uncertainty)
• Solve family of problem instances
with varying “alpha”
- result is the “Pareto optimal” solution set
- shows the shape of the “trade-off” of one
goal versus the other
- discrete (as shown) if IP
- continuous Pareto curve if LP
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
D
B
A
Pareto solution point
Sub-optimal solution point
C
9
Handling Modular Capacity
• Sometimes capacity can only be placed in discrete modules, with
associated cost
e.g. OC-48, OC-192
- but demand flows are still integer or even real valued
- change objective function from...
Min (capacity)
to ....
Min (sum of all modules used * module cost)
s.t. Sum of (modules placed * module capacity) >= capacity
needed
(see book p. 249)
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
10
“Network Reliability”
(book p. 163)
• A specialized field of graph theory that attempts to solve the computational
problem posed by the question:
“If all each edge of a graph is in a working state with probability (1-p)
and failed state with probability p, what is the probability that a route exists
between “:
- nodes s,t -existence of a spanning tree
- all node pairs,
- etc.
(a)
(b)
(c)
0
Example;
p ~ 0.32
1
2
0
2
2
6
5
8
yes
5
9
6
5
9
12
5
8
7
7
10
4
11
6
9
10
4
13
no
8
7
10
3
14
13
yes
8
7
10
1
2
3
14
13
6
12
1
3
14
13
9
0
1
3
14
yes
(d)
0
4
11
12
4
11
12
11
Network reliability = How likely is it that at least one route exists between nodes?
(228 link state combinations to consider here)
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
11
“Network Reliability”
• “Reliability polynomial”:
mi
i
R(G,{s, t}, p)   Ni(G,{s, t}) p (1  p)
m
•
i 0
Prob.of exactly i failed and
(m-i) working edges
Where:
G = graph
{s,t} = a specific node pair
p = edge failure probability
Ni() = number of edge state combinations
containing exactly i routes {s,t}
m = number of edges in graph
E E 681 - Module 6
The real problem: how to
enumerate or estimate these
numbers of states that contain
a path between {s,t} when i edges are
failed
© Wayne D. Grover 2002, 2003
12
“Network Reliability”
(relevance to survivable transport network design )
• two-terminal (s,t} reliability is a bit like a path availability assessment
• However...
- we also need to consider specific structures (e,g rings), not
just the network topology graph.
- we need to consider capacity and exact restoration mechanism
- we don’t need to consider high link failure probabilities nor high
numbers of simultaneous failures
- we can accept the numerical approximation that
“unavailibilities add for elements in series”
(i.e., Ni reduces to ~ number of elements
in normal path plus restoration considerations)
• Graph reduction, factoring and decomposition methods (p. 33) can however
be applied directly to problems of availability analysis.
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
13
Min-cost Network flow (MCNF)
• so far with the LP method we have looked at finding maximum flow, subject
to constraining capacities.
• A related problem is to support a specified flow,
dst between source and
target nodes at min cost for the edges used.
• Two - terminal MCNF :
min
 xij  cij
ijE
S.t.
 xsj  dst ;  xjt  dst
sjE
jtE
x x
j i
Optionally also :
E E 681 - Module 6
ij
j i
ji
 0 i {E  {s, t}}
0  xij  Cij ij  E
© Wayne D. Grover 2002, 2003
Where Cij = edge capacities
14
“Unimodularity”
Maximum flow
and
Min cost network flow
are problems know to have “special structure”
also called “network structure” .....
If all the inputs are integer, ...
the solution will be integer even if you solve
it as a Linear Program not as an Integer Program.
The mathematical property is called “unimodularity”
and it is an important computational advantage whenever a problem
has this special mathematical structure.
Intuitively, the solution is “trapped” onto discrete integer solution values...no operations
in the formulation can fractionate the flow variables
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
15
“Unimodularity”
More formally, unimodularity requires that the matrix A formed
by the constraint system of an IP formulation:
Ax < c
has the properties *:
(i) every ai,j is {-1,0,1}.
(ii) each column contains at most 2 non-zero coefficients.
(iii) there exists a partition (M1,M2) of the set M rows
such that the sum of coefficients in columns of
M1 is equal and opposite to the corresponding
sum of coefficients M2
* Possible project : investigate this criterion further,
write program to detect the “unimodular part” of any given problem
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
16
Related network flow formulations
(Chapter 4)
• Multisource-sink Min cost network flow
- same objective
- every node has source or sink b_i quantity of “commodity” i
- this canonical “transportation problem” is not quite the same as the
communications version….
- It describes net flows from several factories to
several distribution sites.
• Multi-commodity max flow (MCMF)
- numerous source-sink pairs (each a “commodity”) are
simultaneously trying to maximize flow through common set of
finite edge capacities
----> Closely related to later “path restorable mesh” problem.
(a) pure max sum version
(b) maximize smallest proportion of a requirement
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
17
Classical min-cost “transportation problem”
Routing costs
7
A
4
B
C
stores
8
10
7
E
2
• All one commodity
4
12
F
G
6
Z
factories
9
Question is: what assignment of flows to
edges supplies all stores from available factories at minimum cost?
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
18
Communications version: min-cost multi-commodity flow
Routing costs
City A (sink ~store)
7
A
4
B
C
8
10
7
E
2
4
12
F
G
6
Z
9
stores
• Each city pair
is a “commodity”
• only one factory and one store
for each commodity
City Z (source ~factory)
A-Z commodity
C-G commodity
Question is: what assignment of flows to
each edge for each commodity meets all requirements at minimum routing cost?
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
19
Communications version: min-cost multi-commodity flow
Two cases of MCMF:
A. no limits on capacities of edges….
B. finite capacities on edges.
---> shortest path (least cost) routing for each
commodity is optimal (trivial problem)
---> shortest path (least cost) routing for each
commodity is not optimal
• becomes “NP- hard” problem
• the difficulty is the “mutual capacity” issue
• will be at the heart of our later study of the
path-restoration problem
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
20
Quick guide to computational complexity
Problems that are in:
P
have the property that:
-a polynomial time algorithm exists, or can be developed, for
exact solution of the problem. example: The shortest path
2
through a graph (by Dijkstra’s algorithm) is O(n )
NP
- if a guess at the solution is provided, you can at least test its
validity in polynomial time. example: Is there a tour of this
graph that is less that 20 miles?
NP-hard
- it is not even possible to test the validity of a postulated solution in polynomial time. example: Is this specific tour of a
graph the minimal tour?
NP-complete
-as for NP-hard but with the additional generality of scope that
every other problem in NP is reducible to it in polynomial time.
example: (Satifisability) Given a set of boolean logic expressions (clauses) on n binary variables, does any set of binary
values exist that simultaneously satisfies all clauses ?
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
21
Why theoretical complexity matters
• Integer programming (IP) is NP-hard.. and exhibits this behaviour in practise
• Linear programming (LP) (by simplex algorithm) is theoretically NP-hard
but polynomial time in most cases.
• Some newer LP algorithms are provably polynomial time.
• Some Integer Programming problems are “uni-modular” - solve as an LP
without losing integrality
• Other IP s or combinatorial optimization problems in general require heuristic
(or meta-heuristic) solutions.
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
22
Other approaches to combinatorial optimization
“Meta-heuristics” (book: p. 259-267.)
(1) Simulated Annealing (SA)
(2) Genetic Algorithms
(3) Tabu Search
• A “meta-heuristic” is an approximate, but highly general optimization technique
that can be used as an alternative to solving LP / IP formulations.
• It is a “meta- heuristic” because the basic search / improvement tactic can be explained
in a way that is not specific to any one problem.
• Advantages may be:
- handling larger size problems
- representing problem detail not amenable to an LP / IP
- non-linear constraints or objectives
• Results not provably optimal but often this is OK in practice.
• All need quantifiable / calculable objective function
•Central issue each is trying to deal with is effecting a suitably broad search of the
solution space without getting trapped in local optima
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
23
Meta-heuristics: Simulated Annealing (SA)
Basic ideas / concept:
• Inspired by mathematical analogy to strain energy minimization
in the slow cooling (annealing) of metals.
• Changes to the current design are made randomly.
• Improvements are kept, steps backward are normally rejected, except...
• A step “backward” (i.e., a degrading of the objective function) may be kept
with a random probability.
•The probability of keeping such a change slowly decreases.
Where:
paccept  e

E
kT ( t )
E = the magnitude of degradation
t = time (elapsed simulation time)
T(t) = the “cooling schedule”
k = Boltzmanns constant
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
24
Meta-heuristics: Simulated Annealing (SA)
Define a cooling function or schedule T(t) and set:
t = 0,
temperature T(0) := Tmax ;
while T > Tmin do
For n = 1 to Nc do
propose a change in the solution;
evaluate the change in the objective function DE ;
if DE > 0 , accept the move
otherwise, if rand() < Paccept[T(t), DE], accept the move
otherwise reject the move;
End for
t := t+1 ( or often: T :=  T )
Also: keep note of global best ever found at any stage, not just current solution
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
25
Meta-heuristics: Simulated Annealing (SA)
• An additional resource on Simulated Annealing is at the web site:
Simulated Annealing.htm
on the course web-site (related reading section for this lecture).
From “Overview of Modern Heuristic Methods” at
http://www.cs.cf.ac.uk/User/S.U.Thiel/ra/int_rep.html
(where meta-heuristics are being studied for radio frequency assignment
problems).
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
26
Meta-heuristics: Genetic Algorithms (GA)
Basic ideas / concept:
• Inspired by concepts of natural selection and evolutionary
improvement of an evolving population.
• Concepts / terms:
- a population, an individual, a generation
- genome or chromosome, encoding scheme or “schemata”
- selection, fitness function
- cross-over (‘breeding’)
- mutation
• invented / developed by John Holland
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
27
Meta-heuristics: GA Algorithms
• A key to use of GA is finding a suitable schemata
- must encode all relevant aspects of the design
- should permit easy evaluation of fitness function
- must lend itself to a suitable “cross-over” operator
• Crossover example:
AB CDEF GH
A B C DE 6 7 8
+
1 2 3 4 56 7 8
1 23 4 5 FGH
Crossover Point
-uniform random cross-over point
-cross-over may be followed by “chromosome repair”
• Mutation:
- a small random probability of (~ 0.1% typ.) of flipping
a chromosome value (reason ? - search diversification)
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
28
Meta-heuristics: Basic GA Algorithm
t := 0;
initialize a (usually random) population of individuals, P (t=0);
evaluate fitness of all individuals F{ P (t=0) };
repeat
t := t + 1;
P(t) := selectparents {F {P (t-1)}}; (selects sub-population for offspring production
- “roulette wheel” is a common approach)
crossover on P(t);
(recombine the "genes" of selected parents)
mutate P(t);
(perturb
the mated population stochastically)
evaluate fitness of all new individuals F{ P(t) };
select the survivors P(t) := survive (F{P(t)});
until {test for termination criterion (time, fitness, etc.)}.
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
29
Meta-heuristics: GA Algorithms
• Additional resource on Genetic Algorithms:
Overview_of_GAs.pdf
(white paper by Beasley et. al)
on course web-site (related reading section).
• GA s also covered in “Overview of Modern Heuristic
Methods” at http://www.cs.cf.ac.uk/User/S.U.Thiel/ra/int_rep.html
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
30
Meta-heuristics: Tabu Search
Basic ideas / concept:
• uses ideas of conventional “hill climbing” / gradient- type search but with
addition of temporary prohibition of moves that lead back to recently
discovered local optimum.
Cost
Steepest-descent
Tabu Search
Tabu search is forced to accept
“uphill moves”
after reaching a local optimum
because the return move is tabu
for some time following discovery
of the local optimum.
Main proponent and book: Tabu Search by Fred Glover and M. Laguna
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
31
Meta-heuristics: Tabu Search
• Key concepts / terms:
- a “move”
- a “neighbourhood”
- tabu moves, tabu tenure rules
- recency and frequency lists
- aspiration criteria
- search diversification
• Key to a good TS algorithm is usually quite problem-specific policies and memory
structures for deciding what a “move” is and how long moves are “tabu” after
leading to a local minimum.
• “Aspiration criterion” are exceptions to the tabu tenure rules for moves that
happen to lead directly to large solution improvements.
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
32
Meta-heuristics: Basic TS algorithm
i := 0; generate initial solution, so;
repeat
generate neighbour set, N(si), and objective function values for each neighbour
identify taboo neighbor set T(si), (from current list of tabu moves);
identify aspirant subset of taboo neighbors, A(si);
move to best neighbour amongst {N(si) - T(si) + A(si)};
i := i+1 ;
update recency or frequency memories and aspiration criteria (count down tenure
of any currently tabu moves)
Until {test for termination criterion (time, objective value, etc.)}.
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
33
A recent application of Tabu Search
Application to Ring network design optimization
• part of PhD studies by D. Morley (U of A 2001).
•See " Tabu Search Optimization of Optical Ring Transport Networks,"
Globecom 2001, San Antonio, Nov. 25-29, 2001, vol.4, pp. 2160-2164.
• Two types of “move”:
- add a ring (from candidate set)
- delete a ring
• Short-term tabu memory:
if ring r1 is added, we discourage it from being dropped for a specified
number of iterations, called the tabu add tenure.
- if ring r2 is dropped, we discourage it from being added back to the
solution for the tabu drop tenure.
-
• Search diversification strategy: a entirely new starting point design is
generated when:
- a prior solution is revisited
- % improvement in best solution over last n iterations is too low
- absolute improvement in best solution over last n iterations is too low
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
34
A recent application of Tabu Search(2)
Start
Anatomy of a
tabu search
algorithm
Enter with a RingBuilderTM starting design
All
demand
served?
Yes
Feasibility checks:
Is a routing through rings possible
that serves all demand?
Save solution
No
Abort?
Yes
Exit
Progress checks
- could generate diversification re-start here
No
Generate new
starting
solution
Restart?
No
Drop ring
Save solution
Basic “move” strategy
All
demand
served?
Save solution
Yes
- Drop ring each iteration
- Only add ring if feasibility lost
Tabu policy is in here
No
- Deciding which ring add / drop
moves are not allowed (discouraged) at present
Add ring
No
Yes
E E 681 - Module 6
All
demand
served?
© Wayne D. Grover 2002, 2003
35
Tabu Search
140
Understanding Tabu search :
typical TS trajectory
total design cost
120
100
(sample result from D. Morley)
80
• notice how each “restart” is followed first by a climb in cost
(probably due to initial bad drop moves,
requiring adds for feasibility)
then by settling into a new local cost-minima
60
Current Solution
Best Solution
Gap Exceeded
Prev. Solution
40
20
0
0
20
40
60
80
100
iteration
Search diversification re-starts
• For more on Tabu Search see: Tabu Search.htm from the
“Overview
of Modern Heuristic Methods” at
http://www.cs.cf.ac.uk/User/S.U.Thiel/ra/int_rep.html.
E E 681 - Module 6
© Wayne D. Grover 2002, 2003
36