A minimum weighted mean cost cycle algorithm for linear

advertisement
A minimum weighted mean cost cycle algorithm
for linear programming
Jacques Desrosiers and Jean Bertrand Gauthier
GERAD & HEC Montréal, Canada
Email: jacques.desrosiers@hec.ca
Marco Lübbecke
RWTH Aachen University, Germany
1
Introduction
This paper presents the Minimum Weighted Mean Cost Algorithm, a primal method for
solving linear programs. The pivoting step completely avoids degeneracy and allows for
an improvement of the objective function at each iteration. It even does not require a
feasible solution to be basic. This algorithm generalizes the well-known minimum mean
cycle-canceling algorithm of Goldberg and Tarjan (1989), a strongly polynomial algorithm
for solving the capacitated network flow problem. The paper also provides a new necessary
and sufficient optimality condition for linear programming.
2
A non-degenerate pivoting rule
Consider a general linear program (LP ) with lower and upper bounded variables:
? :=
zLP
min c| x
s.t.
Ax = b
(1)
[π]
l ≤ x ≤ u,
where x ∈ Rn+ and b ∈ Rm . Let N := {1, . . . , n} and A := (aj )j∈N . Define π ∈ Rm as
the vector of the dual variables for the equality constraints.
The residual problem.
Let x0 be any feasible solution to (1), not necessarily basic,
that is, vector x0 ∈ [l, u] and it satisfies Ax0 = b. Let the cost of this solution be denoted
z0 = c| x0 . Perform the following change of variables:
xj := x0j + yj+ − yj− ,
yj+ yj− = 0,
1
yj+ , yj− ≥ 0,
j ∈ {1, . . . , n} .
We define the residual problem RP (x0 ) with respect to a given solution x0 as follows.
We replace each variable xj in the original problem by two variables: yj+ represents its
possible increase with respect to x0j while yj− represents its possible decrease; moreover,
only one can be used with a positive value. A vector of the form y+ − y− provides an
improving direction to x0 , if any. Variable yj+ has cost d+
j := cj and residual capacity
+
rj+ (x0 ) ≡ r0j
= uj − x0j , and variable yj− has cost d−
j := −cj and residual capacity
−
rj− (x0 ) ≡ r0j
= x0j − lj . In practice, one only uses the y-variables with a positive residual
capacity. The residual problem corresponding to the flow x0 is defined as
c| y −
?
| + −
zRP
(x0 ) := z0 + min c y
Ay− =
Ay+ −
s.t.
0
≤ r+
0
0 ≤ y+
[π]
(2)
0 ≤ y− ≤ r−
0.
The pricing step. Solution x0 for LP , or y+ = y− = 0 for RP (x0 ), is optimal if there
exists some dual vector π such that the reduced costs of all the y-variables are greater
than or equal to zero, that is,
d¯+
cπj :=
cj − π | aj
j :=
π
|
d¯−
j := −cj := −cj + π aj
≥ 0, ∀j ∈ N
≥ 0, ∀j ∈ N.
(3)
Let γ(x0 ) ≡ γ0 be the smallest possible value of the reduced cost over all the y-variables.
Finding γ0 can be formulated as a linear program:
γ0 :=
max γ
s.t.
γ1 + π | A ≤
γ1 −
π|A
c [y+ ]
≤ −c
(4)
[y− ]
This is an optimization problem over the dual vector π. Taking its dual, one obtains the
pricing problem P P (x0 ) in terms of the y-variables:
γ0 := min c| y+ −
s.t.
Ay+ −
Ay− = 0 [π]
1| y+ +
1| y − = 1
y+ ≥ 0,
Solving the pricing problem.
c| y −
[γ]
(5)
y− ≥ 0.
The above pricing problem P P (x0 ) (5) is a linear
program that can be efficiently solved by the dual simplex algorithm because only the
convexity constraint is not satisfied by the current solution y− = y+ = 0. A few iterations
are sufficient to solve to optimality such a problem. Alternatively, specialized algorithms
can be used in some applications. This is the case for LP defined as the capacitated
minimum cost network flow problem on graph G where the above pricing problem (5)
corresponds to a minimum mean cost cycle problem on the residual graph G(x0 ) (Goldberg
and Tarjan, 1989; Ahuja et al., 1993) which can be solved by dynamic programming in
O(mn), see Karp (1978). For that specific application, the pricing problem identifies a
cycle W containing nW arcs, hence every (positive) variable of the cycle takes value
1
nW
,
that is, the pricing problem finds a cycle with the smallest average cost.
From x0 to an improved solution x1 .
Current solution x0 is optimal for LP if γ0 ≥ 0.
Otherwise, γ0 < 0 and an optimal solution (y+ (x0 ), y− (x0 )) ≡ (y0+ , y0− ) to P P (x0 ) in (5)
identifies a convex combination of positive variables such that Ay0+ − Ay0− = 0. In the
context of the above mentioned application, that of the minimum mean cost cycle problem,
this solution forms an improving cycle on the residual graph G(x0 ). More generally, let
such a solution (y0+ , y0− ) to pricing problem P P (x0 ) be called a cycle on the residual
problem RP (x0 ). Therefore, the objective function minimizes the weighted mean cost of
the cycle formed by the variables of (y0+ , y0− ), where the weights are given by the values
of the selected positive variables.
An associated optimal dual solution to (4) is identified by π(x0 ) ≡ π 0 and γ0 . Denote
by w the entering cycle variable, a new variable that is redundant with formulation (2).
The notation w for this variable mimics the augmenting cycle W in network flow problems,
see Ahuja et al. (1993). With the addition of cycle variable w, the residual problem can
be formulated as:
c| y − + γ0 w
?
| + −
zRP
(x0 ) := z0 + min c y
Ay−
Ay+ −
s.t.
y+
+ 0w = 0
+
y− +
y+
y−
≥ 0,
≥ 0,
y0+
y0−
w ≤
w ≤
[π]
r+
0
−
r0
(6)
w ≥ 0.
Hence, the step size ρ(x0 ) ≡ ρ0 of cycle w relies on the residual capacities of the positive
variables in the y0 -solution of the pricing problem. When γ0 < 0, one can improve the
solution as follows:
(
ρ0 := min
(
min
+
j∈N |y0j
>0
+
r0j
+
y0j
∆z0 := ρ0 γ0 ;
)
(
,
min
−
j∈N |y0j
>0
−
r0j
−
y0j
))
> 0;
(7)
x1 := x0 + ρ0 (y0+ − y0− ) .
Because the pricing problem is solved for variables with positive residual capacities,
this is a non-degenerate pivot (ρ0 > 0) and the objective function strictly improves by
∆z0 = ρ0 γ0 . The x0 -solution is updated to x1 in the direction of the improving vector
(y0+ − y0− ).
3
A necessary and sufficient optimality condition for LP
When γ0 ≥ 0, the current solution x0 is optimal. Otherwise, γ0 < 0 and we obtain a strict
improvement of the objective function ∆z0 = ρ0 γ0 , update the current solution from x0
to x1 := x0 + ρ0 (y0+ − y0− ), and the process is repeated until the following necessary and
sufficient optimality condition for a linear program is met.
Theorem 3.1 A feasible primal solution x0 is optimal for the linear problem (1) if and
only if there exists some dual vector π 0 such that γ0 ≥ 0, as defined by the primal-dual
pair (4)-(5) of the pricing problem P P (x0 ).
Equivalently, the above theorem can be stated in terms of negative cycles on the residual
problem RP (x0 ). This is presented in the following corollary:
Corollary [Negative cycle optimality condition]: A feasible solution x0 is an optimal
solution of the linear program LP if and only if the residual problem RP (x0 ) contains no
negative weighted cost cycle.
Minimum Weighted Mean Cost Cycle Algorithm.
1. Assume a feasible primal solution x to LP of cost z = c| x.
2. Construct the residual problem RP (x).
3. Solve the pricing problem P P (x) for finding the minimum weighted mean cost cycle
(y+ (x), y− (x)) of reduced cost value γ(x).
4. If γ( x) ≥ 0, STOP. The current solution x is optimal for LP .
5. x := x + ρ(x)(y+ (x) − y− (x)), where ρ(x) is the maximum number of units in the
direction of y+ (x) − y− (x).
z := z + ρ(x)γ(x).
Update RP (x).
Return to 3.
References
R.K. Ahuja, T.L. Magnanti, and J.B. Orlin. Network Flows: Theory, Algorithms, and
Applications. Prentice Hall, 1993.
A.V. Goldberg and R.E. Tarjan. Finding minimum-cost circulations by canceling negative
cycles. Journal of the ACM, 36(4):873–886, 1989. doi: 10.1145/76359.76368.
R. Karp. A characterization of the minimum cycle mean in a digraph. Discrete Mathematics, 23(3):309–311, 1978. doi: 10.1016/0012-365X(78)90011-0.
Download