a class of networks with gains
Citation for published version (APA):
Koene, J. (1979). A primal-dual algorithm for solving a maximal flow problem in a class of networks with gains. (Memorandum COSOR; Vol. 7913). Technische Hogeschool Eindhoven.
Document status and date: Published: 01/01/1979 Document Version:
Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers) Please check the document version of this publication:
• A submitted manuscript is the version of the article upon submission and before peer-review. There can be important differences between the submitted version and the official published version of record. People interested in the research are advised to contact the author for the final version of the publication, or visit the DOI to the publisher's website.
• The final author version and the galley proof are versions of the publication after peer review.
• The final published version features the final layout of the paper including the volume, issue and page numbers.
Link to publication
General rights
Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain
• You may freely distribute the URL identifying the publication in the public portal.
If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please follow below link for the End User Agreement:
www.tue.nl/taverne Take down policy
If you believe that this document breaches copyright please contact us at: openaccess@tue.nl
providing details and we will investigate your claim.
STATISTICS AND OPERATIONS RESEARCH GROUP
Memorandum-COSOR 79-13
Apr~mal-dual algorithm for solving a maximal flow problem in a class of networks with gains
by J. Koene
Eindhoven, November 1979 The Netherlands
A primal-dual algorithm for solving a maximal flow problem in a class of networks with gains.
J. Keene
Eindhoven University of Technology Department of Mathematics
Den Dolech 2 Eindhoven
Abstract
In a network with positive gains and without absorbing circuits
(direc-ted cycles) the problem of maximizing
inpu~floW
is considered. Aprimal-dual algorithm to solve the problem is given. The restricted primal pro-blem has been chosen such that it is a propro-blem which can be transformed - by a scaling procedure - to a maximal flow problem in a pure network.
1. Introduction
Special llJ1g.orithms hcwe been developed to solve maximal flow problems in
generalised networks (or networks with gains) [5,8,9,10,14,15J. In all
cases, except Jewell [10J, positive gains are considered. Fujisawa [5J
and Grinold [8
J
handle the case of maximizing output¥low, whereas Jarvisand Jezior [9J and Jewell [10J deal with the case of maximizing
input-I
flow. Onaga [14,15
J
determines the maximal outpu~flow in such a way thatinpu~low
is as small as possible. The problem of maximizinginpu~flow
in a network with gains is denoted as the MFG-problem. In this paper the MFG-problem is considered in a network with positive gains and without absorbing circuits (directed cycles).
It has been observed in literature that under certain conditions a gene-ralised network (G-network) can be transformed to a pure network
(P-net-work) by way of a scaling operation [7,16J. If this is possible we say
that a G-network can be scaled. Obviously a MFG-problem then becomes a maximal flow problem in a pure network (MFP-problem). Reasons why one
would like to scale a G-network are [7J:
- increase of computational efficiency - elimination of round-off errors - simple check for infeasibility
- extending literature available for p-networks to G-networks.
In the following a G-network which can not be scaled is considered. The question we want to deal with is this: suppose the MFG-problem is solved by way of some primal-dual approach. Can the restricted primal problem be chosen in such a way that the underlying restricted G-network can be
scaled and thus the restricted MFG-problem becomes a MFP-problem. An
affirmative answer to this question can be given if networks with positive gains are considered, with the extra condition that the network does not contain any absorbing circuit.
The algorithm presented here can be seen as an extension and a
modifica-tion of Jarvis~ and Jeziors' algorithm [9J. An extension in the sense that ~
involved. A modification in the sense that the restricted primal problem is t~ansformedto a MFP-problem. The possibility of reducing the restric-ted primal problem to a MFP-problem makes it easy to prove finite
conver-96!nce of the algorithm. An advantage is that there is no need to
main-tain basic solutions for the restricted primal problem in order to assure
finite convergence, as in [9J. The notation of [9J is adopted; this
makes it easier to compare with Jarvis' and Jeziors' algorithm.
The rest of this paper is divided into 5 chapters. In chapter 2 the MFG-problem is stated and some terminology used in network MFG-problems is given. Chapter 3 handles the possibility of scaling a G-network. Necessary and sufficient conditions are stated. The primal-dual algorithm to solve the MFG-problem is given in chapter 4 and a proof of its finite convergence to the optimal solution is given in chapter 5. A simple example can be found in chapter 6. Finally some comments are given.
2. The MFG-problem. Some network terminology
We consider a directed connected graph or network G(V,E). V is the set
of nodes (i
=
s,t, 1,2, ••• ,n-2) and E the set of arcs (i,j), i,j € V.Each arc has a positive capacity c
ij and a gain (or multiplier) kij• Two nodes have a special character: the source s and the sink t.
In the following statement of the MFG-problem the variables are x .. ,
~J 2.1 MFG: maximize v s 2.2 st.
l
x ..-
1:
k .. x, . = v i=
s j ~J j J~ J~ s 2.3=
0 i=
s,t i € V 2.4=
-v t i=
t 2.5 0 :s; x, . :s; c, . (i, j) € E ~J ~JThe f\Ulction {x, .} defined on E is said to be a flow if it satisfies (2.3)
~J \ ~
and (2.5); v s is the inpu~flow , v t the outPu~flow. The G-network is com- ~
pletely described by relations (2.2) - (2.5).
The dual of the MFG-problem is given by: 2.6 2.7 2.8 mn~mze \' c y L. i j i j (i,j) € E st.-1T ~ 1 s 1T ~ 0 t 2.9 ~ 0 (i,j) E: E 2.10 Y ij ~
a
(i,j) € EThe complementary slackness conditions are:
2.11 (-1T - l)v =
a
s s
2.13 2.14 ('rr. - k .. 1T. + y ..)xO'
=
0 ~ ~J J ~J ~J y .. (x .. - cO') = 0 ~J ~J ~J (i ,j) E E (i,j) E EFor our purpose it is more convenient to describe them in an other way: Put
2.15 Yi' = max [0, -(1T, - k .. 1T,)]
J ~ ~J J (i, j) E E
then the complementary slackness conditions become:
2.16 1T,
-
k .. 1T, > 0 -+ x ..=
0 l. ~J J ~J 2.17 0 < x ij < cij -+ 1T.~-
k ..~J 1T.J=
0 2.16 1T.-
k .. 1T. < 0 -+ x ..=
c .. ~ ~J J ~J ~J 2.19 v > 0 -+ 1T=
;"1 s s 2.20 v t > 0 -+ 1Tt=
0A pure network is a G-network with k. . = 1 for all (i,j) E E, and as a
~J .
t
consequence of "conservation of flow" inpu1floW V
s always equals output
flow V
t.
A circuit is defined as a directed cycle. If the product of gains along a circuit C is less than (greater than) one, C is said to be an absorbing
3. Scaling of a G-network
In this chapter a G-network is considered which can be scaled. Truemper [16] gives necessary and sufficient conditions under which it is possible to scale a G-network to a P-network:
THEOREM 1. (Truemper) :
The following statements are equivalent:
(1) a G-network can be scaled to a P-network
(2) the rank of the incidencematrix of the G-network equals n-1 (n
is the number of nodes in the network)
(3) nonzero ~ (i = s,t, 1,2, ••• ,n-2) exist such that
k
ij := di kildj = 1 for all arcs (i,j) in the network.
Suppose d. ~ 0 (i
=
s,t,1,2, .•• ,n-2) are at hand; it is easy to transform1.
the G-network into a P-network [16J:
Scalinq procedure : (a) multiply each column (i,j) of the incidence matrix
by d.•
1.
(b) divide each row j of the incidence matrix by d .• J
V
s and xij are transformed in the following way:
Ys := V
Id
s s
3.2 y~J'... := x . .J.J
/d.
l.
From now on it is assumed that k" > 0, V(i,j) E E
1.J
LEMMA 1. If k .. > 0, V(i,j)
E
E we can choose d. > 0, ViE'i
J.J ~
Proof: We have the freedom to choose d
=
+1. By induction its
follows that d. > 0, Vi E V since d. k . ./d. = 1,
1. 1. J.J J
kpplying the scalingprocedure to the MFG-problem the following problem (MFP-problem) is obtained: 3.3 MFP: maximize d s Ys 3.4 fit·ly ..
-f
Yji=
Ys i=
s , 1.J J 3.5=
0 i 'f: s,t 3.6=
-Ys j,.=
t c .. 3.7 0s
y ..s .2:L..
(i, j) E'E 1.J diWe note that the scaled network generally does not have integral arc
capacities even if the G-network has.
solutiontechni~are
availablefor the MFa-problem which assure finite convergence even if the
arccapa-cities are irrational. Efficient (polynomially bounded) algorithms are: [1,2,3,6,11,12] •
Suppose the scaled problem (3.3) - (3.7) is solved. The result is an
op-timal ,solution
Y
ij'Y
s and a min cut (Y, Y) •An analogon of the max flow/min cut theorem is easy to give for a
G-network with positive gains, which can be scaled:
THEOREM 2. In a G-network with positive gains which can be scaled, the following is true:
max flow
=
in which d. 1.
c ..
l
.2:l.
= "weighted" min cut,. d.
1.EY 1. j E
Y
are chosen such that d
=
1,d. k .. /d.=
s 1. 1.J J l,V(i,j)EE
Proof: The maximal flow in the scaled problem is:
iEY j E Y c ..
.2:l.
d. 1. and v equals d y • s s sThe value of the dual objective function is
L
i E yo j EY 'IT=
1/ i d. ~=
0 Yij = 1/ d. ~ = 0 i E Y -i E Y (i,j) E (Y,Y) otherwise c .....=J.
d. ~So we have a feasible primal solution x ..
=
~J V(i,j) E E, a feasible dual solution 'IT" Vi
~
Yij, V(i,j} E E, such that the values of their
tive function are equal. So they are optimal.
4. A primal-dual algorithm for the MFG-problem
In this chapter the following assumptions hold: 4.1
4.2
1. k
ij > Ot V(i,j) E E .
2. there are no absorbing circuits in the G-network A primal-dual algorithm is presented to solve the MFG-problem
for networks for which assumptions 4.1 and 4.2 hold. It has the following structure:
1. Start with x .. = 0, V(i,j) E E, v = 0 and 'IT., y .. such that the dual
~J s ~ ~J
constraints and complementary slackness conditions are satisfied
except for (2.8) and (2.20).
2. Solve restricted primal problem (essentially a MFP-problem). Adjust
vaxiables v and x .. '
S 1.J
3. The current solution is optimal or new values for 'IT. (and y .. ) can be 1. l.J
given and step 2 repeated.
Because v = O,x .. '" O,V(i,j) E E is a primal feasible solution there
s ~J
is no possibility of infeasibility of the MFG-problem. The set of arcs E is partioned into three subsets:
4.3 E
1 := { (i, j) TTi - kij 'IT.J > 0, Yij
=
O}4.4 E
2 := { (i,j) TTi - k ..1.J 'IT.J 0, Yij '" O}
4.5 E
3 := { (i,j) TT.~ - kij 'IT.J < 0, Yij > O}
Arcs in E1 are called inactive arcs, in E2 active arcs, in E3 hyperactive
arcs.
Suppose that as restricted primal problem the MFG-problem is considered with arcs restricted to the set E
2• The following lemma is stated:
LEMMA 2. If 'IT. < 0, V. E V throughout the algorithm then the restricted
1. l.
1
Vi E V. In - k .. 0
Proof. Take d. = - / ., the set E2 1T. 'rl'.
1. 'rl'~ 1. 1.) )
and with the choice of d. it follows:
1.
k..
:= d. k . .Id. = 1 fQr all (i,j ) E EZ1.) 1. l.J J
Theorem 1 says that the network with arcs in E
Z can be
scaled
0
What we search for are feasible 'rl'. < 0 such that the primal relations
1.
and complementary slackness relations hold except for (Z.8) and (Z.20).
If X
ij = 0, V(i,j) € E is chosen initially we need 'rl'i < 0 such that 'rl'1 - k
ij 1Tj ~ 0, V(i,j) € E. Restricting ourselves to generalised
net-works without absorbing circuits such '11'. can easily be found with the
1.
help of a shortest path routine. Whenever absorbing circuits are present,
with a similar argument as Grinold gives in [8,p. 53ZJ, it can be shown
that 1f
i
=
0 might occur for some i € V. Next the algorithm is stated. Aj~.tification is given afterwards. MiG-algorithm
(4.6)
1. Initialisation
Determine the shortest distance A. from s to all nodes i € V,
1.
in which the length of an arc (i,j) is defined as:
d
iJ. := ln k. .l.J A. (i,j) € E
- /.11.
Put 1Ti :
= -
e (1Ts=
-1) i € V(4.7)
2. Consider the MFG-problem with arcs only in E 2
Put d. := _ 1/
1. 1T • 1.
i € V
Perform scaling procedure
Solve the obtained MFP-problem (by one of the procedures in
[1,2,3,6, 11 , 12
J)
Determine new v , xi" V(i,j) E:: E Z
s _ J
3. Consider sets:
{ (i , j )
-4.8 A
1 := i E 'I., j E 'I., 'IT.~ - k, ,~J 'IT,J > a}
{ (i,j)
-
< a}4.9 A
2 ;= i E 'I., j E 'I., 'IT.~
-
kij 'IT,J Determine 4.10 6 1 := max [-00 ('IT, - k .. 'lTj)/kij 'ITj , (i,j) E A1J
,
~ ~J 4.11 62 := max [- 00
,
- {'IT,~ - k .. 'lT~J j)/1Ti,
(i,j) E A2J
4.12 6 := max [-1, 61,62
J
If 6 = -1 the current solution vs' x .. is optimal
~J Otherwise put:
4.13 1T, = 1T, if i E 'I.
~ ~
-4.14 = (1 + 6)1Ti i"f i E 'I.
5. Proof of the MFG-algorithm
LEMMA 3. Initially wi < 0, Vi ~ V and wi - k .. w. ~ 0, V(i,j) ~ E
~J J
Proof. There are no absorbing circuits in the network. So for the product of gains along a circuit (directed cycle)Cwe have:
IT k
ij ~ 1 or with the definition of dij also
(i,j) ~ C
r
(i,j) ~ C
d .. ~ 0 along a circuit. That is to say that there are
~J
no negative cycles in the shortest path problem described in the
-initi~li.;Clti;~-step:--so4~ is-finite-and in accordance with (4.6):
wi < 0 initially for all i ~
v.
BecaU6e ~i is·the shortest distancefrom s to i we have
=
-10 (-WI) and d .. J ~J wi - k .. w. ~ 0 ~J J V(i,j) ~ E = In k ij, so it follows: V(i,j) ~ Eo
o
LEMMA 4. At any iteration of the algor!thm either -1 <a
< 0 and the newwi < 0 or -1
=
a
and the optimal solution is obtained.Proof. Inspection of (4.8) - (4.12) shows that always -1 S
a
<o.
If
a
=
-1 then;=
0 and conditions (2.8) and (2.20) aresatis-t
fied. In lemma's 5,6,7 it will be shown that all primal condi-tions, all dual conditions except (2.8) and complementary slack-ness relations except (2.20) are maintained throughout the
al-gorithm. This proves that if
a
=
-1 the current solution willbe optimal. I f -1 <
a
< 0 from lemma 3 and (4.13) and (4.14) it follows that wi < 0 at any iteration of the algorithm for alli ~ V.
THEOREM 3. Under conditions 4.1 and 4.2 the restricted primal problem
..
can be transformed to a MFP-problem by way of scaling.
LEMMA 5.
LEMMA 6.
All primal constraints are maintained throughout the algorithm.
Proof. Conservation of flow is maintained in all algorithms in [1,2,3,6,11,12J. Initially x
ij = O,V(i,j) € E. By induction
tb6 statement follows
0
All dual constraints except (2.8) are maintained throughout the algorithm.
Proof. 1T
S = -1 in every step (always s € Y). What ever 1Ti might be, with the choice:
the dual constraints are maintained.
o
LEMMA 7. All complementary slackness conditions except (2.20) are
main-tained throughout the algorithm.
-Proof. We define E:.. :
=
1T. - k. . 1T., E:.. :=
1T. - k. . 'IT. (~J ~_ ~J J ~J ~ _~J_J
V(i,j) € E, and determine E: •• for arcs in (y,y),(y.y},(Y,Y) ~J (Y, Y) : (Y, Y) E: . . = E: •• ~J ~J (Y,
Y)
= E: ij-
8k .. 1T,~J J(y,
Y) = E: •. + 81T . ~J ~ (Y, Y) = (1 + 8)E: •• ~Jo
and remains inactive (eij > 0) it becomes active (see (4.10». An inactive arc has e . > 0
iJ unless 6 = e . ./k. .
1T.,
then~J ~J J
An active arc has e .. = O. It remains active
(€ ..
= 0) or it~J _ ~J _
becomes hyperactive if (i,j) € (Y,Y) or inactive if (i,j) € (y,Y).
A hyperactive arc has e .. < O. It remains hyperactive
(€ ..
< 0)~J ~J
unless 6
=
-e.
'/1T.,
then it becomes active (see 4.11».~J ~
So the complementary slackness conditions are maintained.
We have proved sofar that the algorithm converges to the optimal solution. It will be shown that it does so in a finite number of steps.
T~ORE~~4.. The MFG-algorithm reaches the optimal solution in a finite number of steps.
Proof. The following three arguments provide the proof: 1. there are finitely many restricted primal problems.
2. after each dual variable change at least one more node is
attainable in a labeling proce~ So after at most (n-1) dual
variable changes breakthrough will occur, i.e. the objective value strictly increases. Therefore a restricted primal pro-blem is repeated not more than (n-1)times.
3. the restricted primal problem is equivalent to a MFP-problem
6. Example
Fig. 6.1.
Consider the network as specified in table 6.1. Table 6.1 Arcs C.. k. , ~J J.J ·l 51 200 2 s2 200 3
2
s3 150 2 12 225 1 1t 500 1 23 175 3 2 2t 50 3 2 31 300 1 3t 100 1 6 0, 6 1 ln2, 62 3 6 3 ln2, 6t In2=
=
=
In -=
=
iii 2=
-1 1 2 1 1 'II' '11'1=
- 2'
'11'2=
-
,
11'3=
- 2'
11't=
-
-iil 3 2a
1,a
1 2, d2 3 d 3 2, 2=
=
=
•=
dt=
iil 2Calculate 'I1'i - kij '11', for all arcs. The set E
2 is denoted in fig. 6.2.
J
Determine c
1:l
.1
d , for arcs in E1- 2• Determine y, .1.) and xij for arcs in E2• See table 6.2.table 6.2
Fig. 6.2.
Arcs 1f, - k. , 1T, ci/di Yij X
ij
=.
di Yi j l. l.J J 51 0 200 200 200 s2 0 200 0 0 53 0 150 100 100 12 1 0 0 6 1t 0 250 250 500 23 1 0 0 2 2t 21 0 0 31 0 150 50 100 3t 0 50 50 100The saturated arcs are denoted with heavy lines in fig. 6.2.
{s,1,2,3},
{t},
A 1 {(2,t)},=
~, 81 1 8 y=
y=
:::: A 2=
- -9 = 1T=
-1, 1T 1 2 1 4 1=
- 2'
1T2= - 3'
1T3 =- 2'
1T=
-9"
s t d 1, d 1 2, d2 3 d 3 2, dt 9=
::::=
2'
:::: :::: S 4Calculate 1T - k, , 1T for all arcs. The set E
2 is denoted in fig. 6.3.
i l.J j
Detendne Ci/d
Table 6.3. Fig. 6.3.
.
Arcs n. - k .. n, c . ./d. Yij X ij = dij Yij ~ ~J J ~J l-sla
200 200 200 s2a
200 100 100 3 3 s3a
150 100 100 12 1a
a
6 It 1 250 500 18 23 1 0 0 12 2ta
100 100 50 3 3 31a
150 50 100 3t 1 50 100 18y
=
{s,1,2,3},Y
=
{t}, A =~, A =~,e
=
-1. 1 2The maximal inputflow has been reached: v
s 1000 . =
-:r- '
see f~g. 6.4. 1000 3 -650 Fig. 6.4.Some comments
We observe the following: in order to prove finite convergence for their
algorithm Jarvis and Jezior [9J perform in the restricted primal problem
a labeling technique in such a way that the primal solution remains basic. In the algorithm presented here there is no need to demand this.
A good computational efficiency of the algorithm might be expected., since the restricted primal problem can be solved by polynomially bounded al-gorithms.
In [17J Truemper emphasizes the basic relationship between the
MFG-pro-blem and the minimum cost proMFG-pro-blem in pure ~etworks.The structure of this
algorithm makes that even more clear: both problems can be solved by a pri-mal-dual approach in which the restricted primal is a MFP-problem.
Finally we remark that the MFG-algoritm can be converted to an algorithm for solving the problem of maximizing outputflow v
t • This can be done
along the same lines as in [9J. The algorithm is then applicable to
net-works with positive gains and without generating circuits if the follo-wing quantities are redefined:
d ..:= -In k ..
~J ~J
/:, :"'" shortest distance from i E V to sink t
i 'lI'. := eili ~ d. := 1/'lI'. ~ 1. 8 1 := max [-00, - (1T •~ - k, ,~J 1T.)/1T.,J ~ (i,j) E A1
J
82 := max [..co, (1Ti - k, .~J 1T , )J /k ..~J 1Tj , (i,j) E A2
J
1Ti := (1 + 8)1T.,~ i E Y
-'lI', :=
Acknowledgement.
I would like to thank Prof. Dr. J.F. Benders for his v.aluable comments in writing this paper.
Literature
1. E.A. Dinic
Algorithm for solution of a problem of maximal flow in a network with power estimation.
Soviet Math. Dokl. ~(1970) pp. 1277-1280.
2. J. Edmonds and R.M. Karp
Theoretical improvement in algorithmic efficiency for network flow problems.
Journal of ACM ~(1972) pp. 248-264.
3. S. Even and R.E. Tarjan
Network flow and testing-graph connectivity.
Siam J. Comput. !(1975) pp. 507-518.
4. L.R. Ford and D.R. Fulkerson
Flows in networks.
Princeton University Press, Princeton, New J~sey, 1962.
5. T. Fujisawa
Maximum flows in a lossy network.
Proc. of Allerton Conference on Circuit and System Theory,
Urbana, Illinois 1963. pp. 385-393.
6. Z. Galil and A. Naamad
Network flow and generalised path compression.
Dep. of Math. Science$ Compo Science Division, Tel Aviv University,
7. F. Glover and D. Klingman
On the equivalence of some generalised network problems to pure network problems.
Math. Prog. 4(1973) pp. 269-278.
8. R.C. Grinold
Calculating maximal flows in a network with positive gains.
Opns. Res ~(1973) pp. 528-541.
9. J.J. Jarvis and A.M. Jezior
Maximal flow with gains through a special network. Opns. Res, 20(1972) pp. 678-688.
10. W.S. Jewell
Optimal flow through networks with gains
Opns. Res ~(1962) pp. 476-499.
11. A.V. Karzanov
Determining the maximal flow in a network by the method of preflows.
Soviet Math. Dokl. ~(1974) pp. 434-437.
12. V.M. Malhotra, M. Pramodh Kumar and S.N. Maheshwari
An Qdv31> algorithm for finding m~imum f)~ws in networks.
Information Processing letters L(1978) pp. 277-278.
13. E. Minieka
Optimization algorithms for networks and graphs. Marcel Dekker Inc., New York, 1978.
14. K. Onaga
Dynamic programming of optimum flows in lossy communication nets. IEEE Trans. Circuit Theory, CT-13 (1966) pp. 282-287.
15. 1<. Onaga
Optimal flows in general communication networks.
J. Franklin Inst. 283(1967) pp. 308-327.
16. K. Truemper
An efficient scaling procedure for gain networks.
Network,s6(1976) pp. 151-159.
17. K. Truemper
On max flows with gains and pure min cost flows.