Presentation is loading. Please wait.

Presentation is loading. Please wait.

The minimum cost flow problem

Similar presentations


Presentation on theme: "The minimum cost flow problem"— Presentation transcript:

1 The minimum cost flow problem
Given network 𝐷=(𝑁,𝐴) with arc costs 𝑐 𝑖𝑗 , together with balance constraints and possibly arc constraints. Find feasible flow 𝑥 minimizing 𝑖𝑗∈𝐴 𝑐 𝑖𝑗 𝑥 𝑖𝑗

2 Solving the minimum cost flow problem
The problem is a special case of the linear programming problem: Minimize 𝑖𝑗∈𝐴 𝑐 𝑖𝑗 𝑥 𝑖𝑗 Subject to 𝑖𝑗∈𝐴 𝑥 𝑖𝑗 − 𝑗𝑖∈𝐴 𝑥 𝑗𝑖 = 𝑏 𝑖 𝑙 𝑖𝑗 ≤ 𝑥 𝑖𝑗 ≤ 𝑢 𝑖𝑗 Today: A specialization of the simplex algorithm to the minimum cost flow problem - The network simplex algorithm.

3 Simplifying assumptions
Network is connected (as an undirected graph). We can consider each connected component separately. Network is uncapacitated (no arc constraints). We can transform any network to an equivalent uncapacitated network. Alternatively: The network simplex algorithm can be extended to handle upper and lower bounds. The network has no 2-cycles Only simplifies the exposition. The algorithm works also with 2-cycles.

4 LP formulation 𝑖𝑗∈𝐴 𝑐 𝑖𝑗 𝑥 𝑖𝑗 Minimize
𝑖𝑗∈𝐴 𝑐 𝑖𝑗 𝑥 𝑖𝑗 Minimize 𝑖𝑗∈𝐴 𝑥 𝑖𝑗 − 𝑗𝑖∈𝐴 𝑥 𝑗𝑖 = 𝑏 𝑖 𝑥 𝑖𝑗 ≥0 Subject to Following the book we negate both sides of equality constraints – this is done to change the sign of the dual variables.

5 LP formulation and the dual
𝑖𝑗∈𝐴 𝑐 𝑖𝑗 𝑥 𝑖𝑗 Minimize Primal: 𝑗𝑖∈𝐴 𝑥 𝑗𝑖 − 𝑖𝑗∈𝐴 𝑥 𝑗𝑖 =− 𝑏 𝑖 𝑥 𝑖𝑗 ≥0 Subject to − 𝑖∈𝑁 𝑏 𝑖 𝑦 𝑖 Maximize Dual: Subject to 𝑦 𝑗 − 𝑦 𝑖 ≤ 𝑐 𝑖𝑗 𝑖𝑗∈𝐴

6 Introducing dual slack variables
𝑖𝑗∈𝐴 𝑐 𝑖𝑗 𝑥 𝑖𝑗 Minimize Primal: 𝑗𝑖∈𝐴 𝑥 𝑗𝑖 − 𝑖𝑗∈𝐴 𝑥 𝑗𝑖 =− 𝑏 𝑖 𝑥 𝑖𝑗 ≥0 Subject to − 𝑖∈𝑁 𝑏 𝑖 𝑦 𝑖 Maximize Dual: Subject to 𝑦 𝑗 − 𝑦 𝑖 + 𝑧 𝑖𝑗 = 𝑐 𝑖𝑗 𝑧 𝑖𝑗 ≥0 𝑖𝑗∈𝐴

7 Complementary slackness
Let 𝑥 and 𝑦,𝑧 be a pair of feasible solutions to the primal and dual LP. Then these are (simultaneously) optimal if and only if 𝑥 𝑖𝑗 𝑧 𝑖𝑗 =0 for all 𝑖𝑗∈𝐴 .

8 Dictionaries A dictionary defines not just a basic primal solution but also a basic dual solution. They are basic but not necessarily feasible! The pair of basic solutions defined by a dictionary satisfy complimentary slackness. When running the primal simplex algorithm, the dual solution is infeasible until the final dictionary. In fact, the feasibility of the dual solution is exactly the termination criterion.

9 Primal and dual network simplex
Both algorithms work with both a primal and a dual solution. The (primal) network simplex algorithm is used when we have a feasible primal solution. The dual network simplex algorithm is used when we have a feasible dual solution.

10 Spanning trees and bases
A basic solution corresponds to a spanning tree T of the network. Fix a root 𝑟 of T. Erasing the row of the node-arc incidence matrix 𝐴 corresponding to 𝑟 and erasing columns corresponding to arcs not in T results in a non-singular matrix.

11 The primal solution Start at the leaves of T working towards root, assign flow to satisfy balance constraints. The edges in T are basic variables. Assign flow 0 to edges not in T. The edges not in T are non-basic variables.

12 The dual solution Assign 0 to dual variable 𝑦 𝑟 of root.
Assign 0 to dual slack variables 𝑧 𝑖𝑗 for 𝑖𝑗∈𝑇, to make sure complementary slackness conditions are satisfied. Work from root to leaves computing dual variables by 𝑦 𝑗 = 𝑦 𝑖 + 𝑐 𝑖𝑗 for 𝑖𝑗∈𝑇. Compute remaining dual slack variables 𝑧 𝑖𝑗 for 𝑖𝑗∉𝑇 by 𝑧 𝑖𝑗 = 𝑐 𝑖𝑗 − 𝑦 𝑗 + 𝑦 𝑖 .

13 Understanding dual solution
The dual variable 𝑦 𝑖 can also be computed by: Consider path from 𝑟 to 𝑖. Add costs of forward edges and subtract costs of backward edges. The dual slack 𝑧 𝑖𝑗 for 𝑖𝑗∉𝐴 can also be computed by: Consider cycle formed by 𝑖 and T in direction of 𝑖𝑗. Add costs of forward edges and subtract costs of backward edges.

14 Complementary slackness: 𝑥 𝑖𝑗 𝑧 𝑖𝑗 =0 for all 𝑖𝑗∈𝐴 .
𝑖𝑗∈𝐴 𝑐 𝑖𝑗 𝑥 𝑖𝑗 Minimize Primal: 𝑗𝑖∈𝐴 𝑥 𝑗𝑖 − 𝑖𝑗∈𝐴 𝑥 𝑖𝑗 =− 𝑏 𝑖 𝑥 𝑖𝑗 ≥0 Subject to − 𝑖∈𝑁 𝑏 𝑖 𝑦 𝑖 Maximize Dual: Subject to 𝑦 𝑗 − 𝑦 𝑖 + 𝑧 𝑖𝑗 = 𝑐 𝑖𝑗 𝑧 𝑖𝑗 ≥0 𝑖𝑗∈𝐴 Complementary slackness: 𝑥 𝑖𝑗 𝑧 𝑖𝑗 =0 for all 𝑖𝑗∈𝐴 .

15 Observation Since complementary slackness is satisfied by primal and dual solution, we have optimal solutions if 𝑥 𝑖𝑗 ≥0 and 𝑧 𝑖𝑗 ≥0 for all 𝑖𝑗∈𝐴

16 (Primal) network simplex algorithm
Assume 𝑥 is feasible. Do pivot operations to improve the cost of 𝑥 (equivalently: improving the feasibility of (𝑦,𝑧)). Select entering arc: Pick some 𝑖𝑗∈𝐴 with 𝑧 𝑖𝑗 <0. Select leaving arc: Consider cycle formed by 𝑖𝑗 and T in the direction of 𝑖𝑗. Pick backwards edge with minimum flow value. Send flow along cycle to cancel flow on this edge. Update dual solution.

17 Updating the dual solution
Removing leaving arc splits T into two trees. Updating dual variables: If entering arc point from root-containing tree then increase all dual variables in non-root-containing tree by old dual slack of entering arc. Otherwise, decrease all dual variables in non-root-containing tree by old dual slack of entering arc.

18 Updating the dual solution
Updating dual slack variables: Subtract old dual slack of entering arc to arcs bridging in same direction as entering arc, and add old dual slack of entering arc to arcs bridging in the opposite direction of entering arc.

19 The dual network simplex algorithm
Assume (𝑦,𝑧) is feasible. Do pivot operations to make 𝑥 feasible (and thus optimal). Select leaving arc: Pick an arc 𝑖𝑗∈𝑇 with 𝑥 𝑖𝑗 <0. Select entering arc: Find an arc that with T with forms cycle in direction of 𝑖𝑗. Pick such arc with minimum dual slack. Send flow along cycle to increase flow on arc 𝑖𝑗 to 0. Update dual solution as before.

20 Finding the entering arc
Removing leaving arc splits T into two trees. Consider all arcs that bridge the two trees in opposite direction as leaving arc. When such an arc enters the basis all these gets decreased by the dual slack of the chosen arc. Hence we must select one with minimum dual slack.

21 Initialization We can use the dual network simplex algorithm to find the first feasible solution for the (primal) network simplex algorithm. Temporarily set all costs to 0. Then the the dual solution is automatically feasible. Running the dual network simplex algorithm results in a feasible primal solution (i.e. a feasible flow). We can then revert to the original costs and proceed with the (primal) network simplex algorithm.

22 Termination As with the normal simplex algorithm we may have degenerate pivot operations and cycling. We can apply the usual anti-cycling rules. We can still have stalling: long sequences of pivot operations that do not improve the solutions. Specialized pivot operations exists that prevent stalling as well.

23 Complexity In practice the general simplex algorithm very efficient.
Each iteration of the network simplex algorithm is much faster than the general simplex algorithm. In worst case the network simplex algorithm can still make exponentially many pivot operations.


Download ppt "The minimum cost flow problem"

Similar presentations


Ads by Google