150 likes | 172 Views
Chapter 2. Notation and Definitions Data Structures Transformations. Node-Arc Incidence Matrix. Consider the network in Figure 2.13, p. 32. The flow-conservation constraints in the LP formulation are:
E N D
Chapter 2 Notation and Definitions Data Structures Transformations
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:
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
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 Node-Node Adjacency Matrix
2 25 30 3 35 50 0 1 4 15 40 0 2 2 45 10 0 3 3 15 30 5 45 60 0 4 4 3 25 20 35 50 0 5 Array first 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.
Forward Star Similar to the adjacency list but uses fixed-size arrays rather than linked lists. node arc
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.
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
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
b(i) b(j) b(i)- lij b(j)+lij (cij, uij - lij ) (cij, uij ) i j i j xij’ xij 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)
b(i) b(j) b(i)- uij b(j)+uij (-cij, uij) (cij, uij ) i j i j xji xij 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
b(i) b(j) (cij, uij ) i j xij 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. b(j)+uij b(i) -uij (-cij, ) (0, ) i k j xij sij
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.