1 Chapter 2 Notation and Definitions Data Structures Transformations.
-
Upload
delphia-mccoy -
Category
Documents
-
view
227 -
download
0
description
Transcript of 1 Chapter 2 Notation and Definitions Data Structures Transformations.
1
Chapter 2
Notation and DefinitionsData StructuresTransformations
2
Node-Arc Incidence Matrix
Consider the network in Figure 2.13, p. 32. The flow-conservation constraints in the LP formulation are:
Notice that these have a very special form. If we extract the coefficients of the variables into a matrix we get:
12 13 1
12 24 32 2
13 32 43 53 3
24 43 45 54 4
45 53 54 5
x x bx x x b
x x x x bx x x x b
x x x b
3
• It has a row for each node and a column for each arc (n x m)• The matrix consists of 0, +1 and –1 entries• Each column contains one +1 (tail/from) and one –1 (head/to)• The +1’s in a node’s row identify all the arcs emanating from
that node• The –1’s in a node’s row identify all the arcs directed into it
1,2 1,3 2,4 3,2 4,3 4,5 5,3 5,41 1 1 0 0 0 0 0 02 1 0 1 1 0 0 0 03 0 1 0 1 1 0 1 04 0 0 1 0 1 1 0 15 0 0 0 0 0 1 1 1
4
Node-Node Adjacency Matrix
• The (i, j)th element of this n x n matrix contains a 1 if there is an arc (i, j) and a 0 otherwise
• The 1’s in a node’s row indicate arcs emanating from it
• The 1’s in a node’s column identify arcs directed into it
1 2 3 4 51 0 1 1 0 02 0 0 0 1 03 0 1 0 0 04 0 0 1 0 15 0 0 1 1 0
5
Adjacency List
Both the incidence and the adjacency matrix are inefficient for sparse networks. An alternative is to use linked lists to store the arcs that exist. Following the pointers from first(i) identifies all the arcs emanating from node i, along with their costs and capacities.
2 25 30
4
2
3
3 4
5
3
4015
45
15
25 35
45
35
10
30
20 50
60
50 0
0
0
0
0
Array first
1
2
3
4
5
6
Forward StarSimilar to the adjacency list but uses fixed-size arrays rather
than linked lists.
point tail head cost capacity
1 1 1 1 2 25 30
2 3 2 1 3 35 50
3 4 3 2 4 15 40
4 5 4 3 2 45 10
5 7 5 4 3 15 30
6 9 6 4 5 45 60
7 5 3 25 20
8 5 4 35 50
node arc
7
• Arcs are numbered in order of those directed out of node 1, followed by those directed out of node 2, etc.
• To find all the arcs directed out of node i (along with cost & capacity), go to point(i), which stores the index of the first arc directed out of node i and stop when you get to point(i+1) – 1.
• A reverse star is similar except it is organized according to arcs directed into each node.
• Storing both the forward and reverse star means a lot of duplicated information; it can be reduced by a compact forward and reverse star representation.
8
Forward and Reverse Star
point tail head cost capacity trace rpoint
1 1 1 1 2 25 30 1 1 1 1
2 3 2 1 3 35 50 4 2 1 2
3 4 3 2 4 15 40 2 3 3 3
4 5 4 3 2 45 10 5 4 6 4
5 7 5 4 3 15 30 7 5 8 5
6 9 6 4 5 45 60 3 6 9 6
7 5 3 25 20 8 7
8 5 4 35 50 6 8
9
Network Transformations• Simplify a network• Show that two network formulations are equivalent• State in a standard form required by a solution algorithm• Transformations we will use:
– Change undirected arcs to directed arcs– Remove lower and upper bounds– Arc reversal (to change negative costs to positive)
• In each case, the resulting network is equivalent (w.r.t. optimization) to original– at least some of the optimal solutions for the original network
remain optimal in the transformed network
10
Transform Undirected Arcs to Directed• Original undirected arc {i, j} has cost cij0 and capacity uij
(this only works if lij = 0).– Constraint – Term in objective function– In some optimal solution, at least one of {xij, xji} will be zero (non-
overlapping)
• Transformed network has two directed arcs (i, j) and (j, i)– Each has cost cij and capacity uij – If original arc {i, j} has (non-overlapping) flow from i to j and 0
from j to i, then in transformed net, xij = , xji = 0.
– If transformed network has flows xij and xji, then original network has flow
ij ji ijx x u
ij ij ij jic x c x
0 from to and from to if this qty is > 00 from to and from to if this qty is > 0
ij ji
ji ij
j i x x i ji j x x j i
11
Remove Nonzero Lower Bounds
• Original arc (i, j) has lower bound lij > 0• Let “excess flow” • Flow bound constraint becomes• Effect is to decrease b(i) by lij and increase b(j) by lij
• A constant amount cij lij is subtracted from the objective function – does not affect set of optimal solutions
Fig. 2.19 should be: (direction of arc unchanged)
ij ij ijx x l , or 0ij ij ij ij ij ij ijl x l u x u l
i i jj
b(i) b(i)- lijb(j) b(j)+lij
xij xij’
(cij, uij ) (cij, uij - lij )
12
Change Negative Cost to Positive
• Reverse direction of the arc by replacing xij by uij - xji
• Effect is to replace arc (i, j) with cost cij by an arc (j, i) with cost -cij
• Reversal subtracts uij from b(i) and adds it to b(j)
• Equivalent to sending uij units of flow across (i, j) and then subtracting back the new flow xji
i i jj
b(i) b(i)- uijb(j) b(j)+uij
xijxji
(cij, uij ) (-cij, uij)
13
Remove Arc Capacities
• Introduce a slack variable sij 0 so the upper bound constraint becomes
• Interpret constraint as the conservation of flow constraint for a new node k (flow in = demand of uij).
• Subtract this new constraint from the cons. of flow constraint for node j.
, or ij ij ij ij ij ijx s u x s u
i k
b(i) b(j)+uij
xiji j
b(i) b(j)
xij
(cij, uij ) (-cij, )j
-uij (0, )
sij
14
Remove Capacities (cont.)
• If every arc in the original network is capacitated, applying this transformation to each of them results in a bipartite uncapacitated network.– Each original node i becomes a supply node with– Each newly created node (inserted in arc (i, j)) is a demand node
with demand uij
• Original capacitated minimum cost network flow problem with n nodes and m arcs is equivalent to uncapacitated transportation problem with n supply nodes and m demand nodes.
: ,( ) kik k i A
b i u