chp3 2

Upload: mziou-hammadi

Post on 04-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 CHP3 2

    1/12

    OPTIMIZATION 3A GI

    30

    Figure 4.4: Example of transformed network G

    An initial compatible flow is then:

    S1 = 1, S2 = 4, 21 = 1, 13 = 2, 23 = 2, 2T = 1, 3T = 4

    3.6 Minimum cost f low problems

    3.6.1 Problem def init ion

    Consider a connected network G = (N, A, L, K, C), where L is the vector of lower

    bounds (l1, l2, ,lm)T, K is the vector of capacities (k1, k2, ,km)

    T, and C is the vector

    of costs (c1, c2, ,cm)T. The cost of transporting a unit of flow on arc u is cu (notice

    the change of notation). Therefore if is the flow vector, the total flow cost is:

    u uu Ac

    .

    Hence, the minimum cost flow problem consists in:

    Finding, among maximum value flows, a feasible flow that minimizes totalcost.

    Or, Find the minimum cost way of transporting a flow of a fixed value v. In thiscase, if v > maximum value flow, the problem is infeasible.

    S

    3

    1

    2

    T

    4

    7

    52

    0

    3

    2

    ST

    1

    4

    2

    32

    3

    +S

    +1

    +

    (1)

    (1)

    (3)

    +S

    +2

    +T(4)

    (4)

    (2) (2)

    +3

    (2)(2)

    (2)

  • 7/30/2019 CHP3 2

    2/12

    OPTIMIZATION 3A GI

    31

    3.6.2 Applications

    a. Optimal production planning

    Consider the case of company that wants to plan the production of a given product

    over a horizon of n periods. Knowing for each period i (i = 1 n):

    The demand di, the maximal production capacity ui, production cost/unit ci, storage capacity si, storage cost/unit hi, which applies to quantities left unused at th end of period i,

    The problem is to determine the quantities to produce at each period, so that

    demand of each period is satisfied with a minimum cost possible. Assume that initial

    inventory is zero.

    This problem can be reduced to finding a flow vector of a fixed value in a network G =

    (N, A, C) constructed as follows:

    Associate a node to each period i (i = 1n), introduce two additional nodes S and T, link the node S to each node i with an arc (S, i) of capacity u i and a cost ci : a

    flow on the arc (S, i) represents production during period i,

    link each node i with the node T with an arc (i, T) of capacity di and zero cost:a flow on the arc (i, T) represents demand of period i,

    link each node i (i = 1n-1) to node i+1 with un arc (i, i+1) of capacity si andacost hi : a flow on the arc (i, i+1) represents the quantity stored at the end of

    period i.

    It is easy to verify that to each feasible flow between S and T of a value v = i di

    corresponds a feasible production plan. The optimal plan is then obtained by solving a

    minimum cost flow problem.

    b. Assignment problem

    Consider the situation where n operators have to be assigned to n jobs. Let cij be the

    cost of assigning operator i to job j. The problem is to determine a minimum cost

  • 7/30/2019 CHP3 2

    3/12

    OPTIMIZATION 3A GI

    32

    assignment of operators to jobs. This problem can be transformed into a minimum

    cost flo problem in a bipartite network.

    Let N1 be the set of operators and N be the set of jobs:

    For each i N1 and each j N2, create an arc (i, j) with a cost equal to cij and a

    capacity equal to 1.

    Create two additional nodes S and T: the node S is linked to each node i N1 and

    each node j N2 is linked to node T. The arcs (S, i) and (i, T) have zero costs and

    capacities equal to 1.

    One can verify that to each flow between S and T of value n corresponds a feasible

    assignment une affectation ralisable (and vice versa). The cost of such a flow is

    equal to the assignment cost.

    3.6.3 Residual net work

    Let = [1, 2, , m]T be a flow vector from S to T in G, satisfying the constraints:

    0 u cu. The residual network associated with is the network G() having thesame set of nodes as G, and which the set of arcs is defined as follows:

    To each arc u = (i, j) of G corresponds, at most, two arcs in G():

    u+ = (i, j) if luu < ku ;this arc has a residual capacity rij = ku - u > 0 and a cost cu+=cu

    u- = (j, i) ifu > lu this arc has a residual capacity: rji = u > 0and a cost cu-=-cu

    Theorem 3.3

    A necessary and sufficient condition for a feasible flow to be of minimum cost in G

    is that no negative circuit exists in G().

    This theorem shows that an optimal flow may be obtained by starting with a feasible

    flow of value v and searching for a negative circuit in the residual network. If such acircuit does not exist, then we conclude that the current solution is optimal.

  • 7/30/2019 CHP3 2

    4/12

    OPTIMIZATION 3A GI

    33

    Otherwise, it is possible to increase the flow in the circuit by the minimum residual

    capacity. The total value of the flow remains the same but its cost decreases.

    3.6.4 Solut ion met hods

    We distinguish mainly two methods for solving tne minimum cost flow problem:

    - Klein algorithm (modified by Bennington),- Algorithm of Busacker and Gowen (also called Roy algorithm).

    a. Klein algori thm (1967)

    It consists in finding, among maximum value flow vectors, the flow = [u] that

    minimizes the total cost C = uU cu u

    Starting with a maximum value flow (obtained for example by the Ford-Fulkerson

    algorithm), we seek to determine negative circuits in the corresponding residual

    network. If such circuits do not exist, then the current flow is of minimum cost;

    otherwise, a substitution along one of these circuits gives a flow with a smaller cost.

    In this case, a new residual network is constructed and the process continues.

    Algori thm of Klein (1967):

    Step 0:

    k = 0

    Using a maximum value flow algorithm, find a maximum value flow for G.

    If no feasible flow exists, Terminate, the problem is infeasible.

    Otherwise, let 0 be this flow vector.

    Step 1:

    Let kbe the flow at the kth iteration.

    Construct the residual network G(k) associated with k.

    Step 2:

    Serach for a negative circuit in G(k).

    If such a circuit does not exist, the curent flow vector is optimal, Terminate.

  • 7/30/2019 CHP3 2

    5/12

    OPTIMIZATION 3A GI

    34

    If such a circuit exists, Let be the cycle corresponding to in G.

    let = min(i,j) (kij) the residual capacity of circuit . Define the flow vector k+1 as

    follows:

    u k+1 = u k + if u+

    uk+1 = u

    k - if u-

    Set k = k + 1 and go back to step 1.

    The main issue in this method is how to find a negative circuit. In fact, the search for

    such circuits is achieved by planting a tree rooted at T (the destination) and covering

    the considered residual network. The algorithm of Bennington solves this problem

    through the enhancement of a first algorithm proposed by Klein.

    Algorithm for finding a negative circuit

    Step 0:

    Construct an arbitrary R1 rooted at T and spanning G1 (having the same set of node as

    G1), i = 1;

    Step 1:

    Associate to each node x of Gi a value hx defined as:

    hT = 0 and hy = hx + cxy if arc (x, y) Ri,

    Step 2 :

    Choose, if it exists, un arc (x, y) of Gi that does not belong to Ri and such that:

    hx + cxy < hy

    If such arc does not exist, Terminate: in fact, the hx are the minimum costs of paths

    from T to x, for all x. As a consequence, Gi does not have any negative circuit.

    Otherwise:

    If the path from T to x in Ri traverses y, then the concatenation of the subpath

    extracted from Ri: (y, , x) and the the (x, y) yields a negative cycle,

    Otherwise, modify the tree Ri by deleting the arc (z, y) of Ri (where z is the unique

    predecessor of y in Ri) and adding the arc (x, y);

    i = i + 1, go to step 1.

  • 7/30/2019 CHP3 2

    6/12

    OPTIMIZATION 3A GI

    35

    Example: a flower vendor needs to transport flowers from its flower field (S) to the

    city (T), using various vans of different capacities. The roadway network linking S to T

    is given in Figure 4.5, where each arc is described by its capacity (in boxes/week) and

    its unit travel cost (TND/box).

    The vendor wants to study the problem of transporting the flowers per week so that

    the maximum quantity is transported for a minimum cost.

    Figure 4.5: Example of the flower vendor

    Let us apply Klein algorithm:

    Step 0 : Using Ford-Fulkerson algorithm, we search for a maximum value flow vectorfor G:

    Let the initial solution be:

    S 1 T : flow = 200

    S 2 3 T : flow = 200

    An augmenting path for this solution is:

    S 1 3 T with an incremental flow = 100.

    With this solution, we can no longer label the destination T: This is an optimal value

    flow with a value of500 boxes and a cost of7300 TND.

    Let 0 be this flow.

    (200, 13)

    (200, 9)

    (200, 16)

    (300, 0)(200, 2)

    (200, 0)

    S

    1

    2

    3

    T(400, 2)

  • 7/30/2019 CHP3 2

    7/12

    OPTIMIZATION 3A GI

    36

    Step 1:

    The above is the residual network G(0) relative to 0.

    Step 2 : Look in G(0) for a circuit with a negative cost relatively to the cost

    vector c. To do this, construct a spanning tree for G(0) :

    Figure 4.6: A spanning tree for G(0)

    The arc (1, S) dos not blong to the spanning tree and h1 + c1S < hS (-18 < -13).

    The path from T to 1 in the tree does not go through S: Erase the arc (2, S) and add

    arc (1, S). hS = -18

    The arc (1, 3) does not belong to the new tree and h1 + c13 < h3 (-7 < 0).The path from T to 1 in the tree does not go through node 3: Erase the arc (T, 3) and

    add the arc (1, 3). h3 = -7 and h3 = -20.

    (100, 2)

    (300, -2)

    (100, -9)

    (200, -13)

    (100, 9)

    (200, -16)

    (300, 0)(200, 2)

    (200, 0)

    S

    1

    2

    3

    T

    [0]

    [-13]

    [-13]

    [0]

    (200, -13)

    (200, -16)

    (300, 0)

    (200, 0)

    S

    1

    2

    3

    T

    [-16]

  • 7/30/2019 CHP3 2

    8/12

    OPTIMIZATION 3A GI

    37

    Figure 4.7: New spanning tree for G(0)

    The arc (2, 1) does not belong to the newly chosen tree and h2 + c21 < h1 (-18 < -16).

    The path from T to 2 in the tree goes through node 1: we have a negative circuit with

    a cost = -2 : (1, 3, 2, 1).

    The smallest capacity on this circuit equals 100: in the network G, increase the flow

    on the arcs (2, 1) and (1, 3) by 100 boxes and reduce the flow on the arc (2, 3) by 100

    boxes.

    Therefore, the cost is reduced by 100 * 2 = 200 TND

    The new tree is obtained by eliminating the arcs (1, 3) and (3, 2) and by adding the

    arcs (1, 2) and (2, 3).

    No more negative circuits. Hence, the flow obtained is optimal. END.

    The optimal solution is the following:

    (S, 1) = 300, (S, 2) = 200, (2, 1) = 100, (2, 3) = 100, (1, 3) = 200, (1, T) = 200,

    (3, T) = 300.

    Its value is = 500 boxes, its cost is = 7100 TND.

    b. Algori thm of Busacker and Gowen

    Here, we want to find a flow vector = [u] with a fixed value at minimum cost.

    Starting with a zero flow vector (or any other flow with a value v0), construct a flow

    of value v1 and having a minimum cost among all flow vectors of the same value. Then

    construct a flow of value v2 > v1, and at minimum cost, , etc until a flow of value v*

    is obtained. This is achieved by searching, at each iteration, in the associated residualnetwork, a minimum cost path from S to T and by modifying the flow on its arcs.

    [-18]

    [-20]

    [-7]

    S

    1

    2

    3

    T

    [-16]

    [0]

  • 7/30/2019 CHP3 2

    9/12

    OPTIMIZATION 3A GI

    38

    Algorithm of Busacker and Gowen

    Step 0:

    Choose as initial flow 0 the null flow vector: v(0) = 0.

    The residual network G0(0) is then identical to the initial network G.

    Set i = 0.

    Step 1:

    Determine, using an appropriate algorithm, a minimum cost path from S to T in the

    residual network Gi.

    If such a path does not exist, then Terminate: the current flow is optimal.

    Otherwise, go to step 2.

    Step 2:

    To the path just found corresponds an augmenting chain in G. Increase the flow in G

    by the allowed amount i on this chain. This gives the ne flow vector i+1 of value

    v(i+1) = v(i) + i.

    Step 3:

    Construct the residual network Gi+1 associated with this new flow vector.

    Set i = i + 1 and go to step 1.

    At the end of this algorithm, we obtain a maximum value flow having a minimum

    cost. In case a lower value is sought, the algorithm should be stopped once this value

    is reached.

    Example: Reconsider the previous example (see Figure 4.5).

    Apply Busacker & Gowen algorithm:

    Step 0: Let 0 be thenull flow vector.

    The residual graph G0 is identical to G, i = 0.

    Step 1: Apply Ford-Bellman to find a minimum cost (shortest) path from S to T in G0.

  • 7/30/2019 CHP3 2

    10/12

    OPTIMIZATION 3A GI

    39

    Iteration S 1 2 3 T

    0 0 2 0

    1 0 2 0 11 18

    2 0 2 0 11 11

    3 0 2 0 11 11

    The optimal path is: S 2 1 3 T, with a cost of 11 DT/box.

    Step 2:

    Increase the flow in G by the maximum allowed amount on the associated chain: =

    200 boxes, giving the flow of value 200.

    Step 3: The residual network G1 associated with this new flow vector is the following:

    Figure 4.8: Residual network G1

    Step 1: Apply Ford-Bellman to find the shortest path, in terms of cost, from S to T in

    G1.

    Iteration S 1 2 3 T

    0 0 2

    1 0 2 0 18

    2 0 2 0 13 18

    3 0 2 0 13 13

    The optimal is S 1 2 3 T, with a cots of 13 DT/box.

    (200, 0)

    (200, 13)

    (200, -9)

    (200, 16)

    (100, 0)(200, -2)

    (200, 0)

    S

    1

    2

    3

    T(400, 2)

  • 7/30/2019 CHP3 2

    11/12

    OPTIMIZATION 3A GI

    40

    Step 2:

    Increase the flow value in G by the maximum allowed amount =100 boxes. This gives

    a flow 2 having a value of 300.

    Step 3: The residual network G2 associated with this new flow vector is the following:

    Figure 4.9: Residual network G2

    Step 1: Apply Ford-Bellman to find the shortest path, in terms of cost, from S to T in

    G2.

    Iteration S 1 2 3 T

    0 0 2

    1 0 2 0 18

    2 0 2 0 13 18

    3 0 2 0 13 18

    The optimal path is: S 1 T, with a cost of 18 DT/box.

    Step 2:

    The flow value can be increased by =200 boxes, giving the flow 3 of a value 500.

    Step 3: The residual network G3 associated with this new flow vector is the following:

    (100, -13)(100, 2)

    (100, -2)

    (100, 13)

    (200, -9)

    (200, 16)

    (300, 0)(100, -2)

    (200, 0)

    F

    1

    2

    3

    T(300, 2)

  • 7/30/2019 CHP3 2

    12/12

    OPTIMIZATION 3A GI

    41

    Figure 4.10: Residual network G3

    There is no path from S to T in the residual network G3. END.

    The optimal solution is the following:

    (S, 1) = 300, (S, 2) = 200, (2, 1) = 100, (2, 3) = 100, (1, 3) = 200, (1, T) = 200,

    (3, T) = 300.

    The total flow = 500 boxes with a cost of7100 DT.

    (100, -13)(100, 2)

    (300, -2)

    (100, 13)

    (200, -9)

    (200, -16)

    (300, 0)(100, -2)

    (200, 0)

    S

    1

    2

    3

    T(100, 2)