Diagnosing infeasibilities in network flow problems

Mathematical Programming 81 (1998) 263-280 Diagnosing infeasibilities in network flow problems Charu C. Aggarwal a, Ravindra K. Ahuja James B. Orl...
6 downloads 2 Views 3MB Size
Mathematical Programming 81 (1998) 263-280

Diagnosing infeasibilities in network flow problems Charu C. Aggarwal

a,

Ravindra K. Ahuja

James B. Orlin

d

b

Jianxiu Hao

C

d*

a IBM Thomas J. Watson Research Center, Hawthorne, NY 10532, USA b Department of Industrialand Management Engineering, Indian Institute of Technology, Kanpur - 208016, India c GTE Laboratories, TWaltham, MA 02154, USA Sloanz School of' Management, MassachusettsIstitute of Technology, SO Menorial Drive E53-357, Cambridge, MA 02139, USA

Received 15 June 1994; revised manuscript received 31 March 1997

Abstract We consider the problem of finding a feasible flow in a directed network G = (N,A) in which each node i N has a supply b(i), and each arc (i,j) A has a zero lower bound on flow and an upper bound uij. It is well known that this feasibility problem can be transformed

into a maximum flow problem. It is also well known that there is no feasible flow in the network G if and only if there is a subset S of nodes such that the net supplies of the nodes in S exceeds the capacity of the arcs emanating from S. Such a set S is called a witness of infeasibility" (or, simply, a wtiitness) of the network flow problem. In the case that there are many different witnesses for an infeasible problem, a small cardinality witness may be preferable in practice because it is generally easier for the user to assimilate, and may provide more guidance to the user on how to identify the cause of the infeasibility. Here we show that the problem of finding a minimum cardinality witness is NP-hard. We also consider the problem of determining a minimal witness, that is, a witness S such that no proper subset of S is also a witness. In this paper, we show that we can determine a minimal witness by solving a sequence

of at most n maximum flow problems. Moreover, if we use the preflow-push algorithm to solve the resulting maximum flow problems and organize computations properly, then the total time taken by the algorithm is comparable to that of solving a single maximum flow problem. This approach determines a minimal cardinality witness in O(n 2 ml/2 ) time using simple data struc-

tures and in O(nm log n) time using the standard implementation of the dynamic tree data structures. We also show that the recognition version of the minimal witness problem is equivalent to a recognition version of a related problem known as the minimum rooted cut problem. © 1998 The Mathematical Programming Society, Inc. Published by Elsevier Science B.V. Keywords: Network flows; Maximum flow problem; Preflow-push algorithm

Corresponding author. Present address: IBM Thomas J. Watson Research Center, Yorktown Heights, NY 10598, USA. S0025-5610/981$19.00 © 1998 The Mathematical Programming Society, Inc. Published by Elsevier Science B.V. PI [S 0 0 2 5 - 56 1 0(9 7)0 0 04 8 - 8

_^C_______Vl_____qC__II*llqa(·-a(-*-·CP

C.C. Aggarwal et al. / Mathematical Programming 81 (1998) 263-280

264

1. Introduction An important aspect of the analysis of linear programming probiems is that of de-

tecting infeasibilities. In particular, given a set of linear inequalities, we would like to know whether this system is feasible or not. Further, once it is known that the system is infeasible, one may need to isolate the cause of the infeasibility even further; that is, one may like to find a small subsystem of equations for the linear programming problem that forms an infeasible system. In general, it is NP-hard to find a minimum

infeasible subsystem of equations for a linear programming problem; however, it is possible to find in polynomial time a minimal irreducible subsystem of equations

which forms an infeasible subsystem in itself, and such that no subset of it is infeasible (see, for example, [1,2]). In this paper, we shall consider this problem in the context of network flows. Diagnosing infeasibilities for network flow problems was first studied by Greenberg [3,4]. The advantage in considering this particular case is that we can make use of the nice structure of the network flow problem in order to come up with fast combinatorial methods for solving it. Here, we consider a network flow problem defined on a directed network G (N, A) with n = INI and n AA. The supplyldemand of a node -i e N is b(i), where a positive value indicates a supply and negative value indicates a demand. We assume that Ec, b(i) = O.The capacity of each arc (i, j) A is ui, and the lower bound on each arc flow is zero. The network feasibilityproblem we study is to determine whether the following set of mass balance and flow bound constraints admits a feasible flow x:

S O xij

5-

x

fj: (if)CA}

u

xj1

E j

forall i N,

(Ia)

C A.

( b)

(jCi)CA}

for all (j)

Let S c N be any proper subset of the node set N and let S- denote its complement, that is, S- _ N \ S. Let b(S) = Zis b(i) and u[S, S-j -{cA(ij) : iESiEScS} Uij It is well known (see, for example, [5,6]) that (1) admits a feasible flow if and only if b(S) ( u[S, SJ, for every proper subset S of nodes. Equivalently, () is infeasible if there exists a proper subset S of the node set AT satisfying b(S) > u[S,S-].

(2)

A subset S of nodes satisfying (2) is called a witness of infeasibility (or, simply a witness). Intuitively, a network having such a property has no feasible solution because the net supply b(S) on the set S of nodes has to escape from S through the arcs directed from S to S-, but the sum of the capacities of these arcs is strictly less than b(S). While all witnesses are equally valid in proving that a network flow problem is infeasible, not all of them provide an equal amount of guidance to the user of a modeling system. This point is well articulated by Greenberg [4] who writes, "I say that a witness offers a good diagnosis if the information from the witness provides a useful

--_IX-TI---C---··-I--sll·CI-

-iP-_

SLC-P -

--L

-^1 ·-

__

- C·-

II-

C. C Aggarwal et al. / Mathematical Programming 81 (1998) 263-280

265

starting point, where we need only a modest amount of additional analysis to form a

complete diagnosis that correctly identifies the cause". As described by Greenberg, one of the features of a witness that is particularly relevant to its use in diagnosis is its cardinality. In general, the smaller the witness, the more easily a user can analyze it. The larger the witness, the more difficult it is for a user to comprehend its cause. In this paper, we shall focus on the size of the witness. We show that determining a minimum cardinality witness is an NP-hard problem. We establish this result in Appendix A by reducing a special case of the clique

problem to the minimum cardinality witness problem. ''' ''''''

We next focus on the minimal cardinality witness problem defined as follows. We call a set S' c S a subwitness of S if S' is also a witness. We call a witness S minimal if no proper subset of S is a subwitness, that is, S has no proper subwitnesses. We show that we can determine a minimal witness by solving a sequence of at most n maxi-

mum flow problems. Moreover, if we use the preflow-push algorithm to solve the resulting maximum flownd organize computations properly, then the total time taken by the algorithm is comparable to that of solving a single maximum flow problem. This approach solves the minimal cardinality witness problem in O(n2m 1/2 ) time using simple data structures and in O(nm log n) time using dynamic tree data structures. Our approach uses some of the concepts and ideas contained in the algorithm of [7] for the minimum cut problem. Gallo et al. [8] use a related approach for a fast solution of a parametric maximum flow problem.

A problem closely related to the minimal witness problem is the minimum rooted cut problem. The minimum rooted cut problem is the problem of selecting a subset S of nodes containing a specified root node s so that u[S, S-] is minimum. Hao and Orlin [7] describe an algorithm to solve the minimum rooted cut problem in O(nnm log(n2/m)) time using techniques that are very similar to the techniques in this paper. In this paper, we show the equivalence between recognition versions of the minimum rooted cut problem and the minimal witness problem.

2. Preliminaries In this section, we present some elementary results that will be used in developing the minimal witness algorithm.

'' c

2.1. Single-solurce single-sink assumnption

We shall solve the minimal witness problem in a network that has exactly one supply node and exactly one demand node. The following lemma shows that there is no loss of generality in this assumption. Lemma 1. Let G- (N,A) be a network with arbitrary supplies/demands. Then there exists a netvwork G (N°,A° ) ith exactly one supply node s and exactly one demand

-----ll-L---^------·---

I--I

--------Csl9F--

- ·C

·-

-L

-

----

__ _

I __

____

266

C. C. Aggarwal et al. / Mathematical Programming 81 (1998) 263-280

node t such that there is one-to-one correspondence between

itnesses in G and

witnesses in G.

'^' ' ' " "c-": ' ''

Proof. We augment the network G by introducing two new nodes s and t. For each node i E N with b(i) > 0, we add an arc (s, i) with capacity b(i). For each node i E N with b(i) < Owe add an arc (i, t) with capacity -b(i). Let Go = (N, 0 AO) denote the augmented network and let b and uO respectively denote the node supply/demand and arc capacity vectors. In G, we define b(s) = -b 0 (t) E{iEN: b(i)>0} b(i), and bo(i) = for all i C No - s, t}. Let S C N be a subset of nodes such that s S and t EC S-. Let SO = SU{s}. Further, let b(S)= Zis: b(i)>0} b(i), and b-(S) = Cis b(i) and this is possible only if s C S and t E S-. Therefore, cuts considered in this paper are invariably s-t cuts. Let (S,S-) denote the set of forward arcs in the cut [S,S-], that is, (S,S-) = {(i,j) E A: i S andj S-}. Then (S-,S) denotes the set of backward arcs in the cut, that is, (S-,S) = {(ij) A: i E S- and j E S}. We define the capacity of the cut [S, S-] to be u[S, S] = (i.j)f(S.S-) Uij.

C-F-^-I··-·---L--·-r-_-_-__l___ ---

_C

II

I-----L -T-P----TI -

CsL-

---ra

---

C. C Aggarwal et al. I Mathematical Programming 81 (1998) 263-280

267

2.3. Prefiows Since we assume that the network G contains a witness, it follows that G does not

admit any feasible flow x. However, it admits a preflow, which is a relaxation of flow. A preflow x satisfies the flow bound constraints (b) and the following relaxation of (la): b(i) +

,

xi -

{j (i)CA}

x > 0

a

for all i N-{t}.

(j: (ij)CA}

For a given preflow x, we define the excess of each node i f'.. "'-"'·-' ;· ··.' -''-:''*·I ··-··-·c · l. " "' ""

e(i) = b(i) +

.r· ;·-··; · ···oL._-·_· .·.·i'''··r·"·-I_"

C Xij.

xji{i:

N as (3)

{j: (.j)EA}

In a preflow x, e(i) 0 for each node i E N \ {t}, and e(t) can be negative. We refer to a node with strictly positive excess as an active node.

2.4. Residual network The concept of residual networks plays a central role in the description of our algorithm. Given a preflow x, the residual capacity-i of any arc (i,j) A is the max-

imum additional flow that can be sent from node i to node j using the arcs (i,j)and (j, i), and is defined as rij - (ui1 - xi) + xji. Note that if arc (i,j) does not exist, then xi 1 is interpreted as zero in the definition of ri.1 We refer to the network G(x) consisting of the arcs with positive residual capacities as the residual network (with respect

to the flow x). For any set S of nodes, let e(S) = ECse(i) and let r[S,S-] = E(i.)c(ss-) r. We give below an alternate definition of witnesses. Property 1. A set S of nodes is a witness if and only iffor an)y preflow x, e(S) > r[S, S-].

Proof. Let x be any preflow in G. Summing (3) for all i E S yields e(S) - b(S) +

>

x {j: U(j,i)cA, jc-S}

x 1.

(4)

{j: (ij)EA, jES)

Adding E(ij)c(s-) ui1 = u[S,S-] to both sides of (4) and using rij = (uij - xj) + xji

yields e(S) + u[S,S-] = b(S) + r[S, S-], which can be restated as e(S) - r[S, S-] = b(S) - u[S,S-]. It follows from this equation that S is a witness, that is, ''

''

b(S) > u[S,S-] if and only if e(S) > r[S,S-].

F

2.5. Strong witnesses

A pair (S, x), where S is a set of nodes and x is a preflow, is called a strong witness if e(S) >

and r[S, S-] = O.It follows immediately from Property I that if (S, x) is a

strong witness, then S is a witness. The algorithms developed in this paper always maintain an incumbent strong witness and attempt to find a strong subwitness of the incumbent.

----Y··---i-)ll^r*---rrc-----·pl----l----X-

--.-*14Clllb·CI··IIIClb--"C-I-

I-

--.-^----·C1r

-

--

---s-------------

------FFI--llllll

II ·--

--

--

li-·

--- -

--

C.C Aggarwal et al. I Mathematical Program2ming81 (1998) 263-280

268

3. Preflow-push algorithm Our minimal witness algorithm draws concepts from Goldberg and Tarjan's preflow-push algorithm [9]; we therefore briefly review this algorithm in this section.

Additional details about the algorithm and its proofs can be found in [6,9]. The preflow-push algorithm maintains a preflow x at every step. It also maintains a distance label d(i) with each node'i with respect to a (target) node w to which flow needs to be sent. The distance labels are said to be valid with respect to a preflow x and the target node Hv if they satisfy the following validity conditions: ''*'

"' c.

d(w) -O

(5a)

d(i) < d(j) + 1 for every arc (i,j) E G(x).

(5b)

We call an arc (i,j)in G(x) admissible if d(i) = d(j) + 1. Let numb[p] denote the number of nodes in S whose distance labels equal p. We say that the numb array does not contain a gap if the positive entries in the numb array are consecutive; otherwise we say that the numb array contains a gap. We say that the numb array contains a gap at the pth position if numb[p] =0, numb[r] > 0 for some r > p, and numb[q] > 0 for some q < p. The numb array allows us to find subwitnesses of S, as indicated by Property 2. This property is based on a result due to Derigs and Meier [10]. Property 2. Suppose that the numb arraycontains a gap at the pth position with respect to a preflow x' and valid distance labels d. Let S' = i E S: d(i) > p}. If e(S') > 0, then (S', x') is a strong witness. Proof. Observe that d(i) > p for all i E 8' and d(j) < p for all j , S'. Thus, for each arc (i,j) E (S', S-'), d(i) > d(j) + 1. Since distance labels satisfy the validity conditions (5b), it follows that in the residual network G(x), (S',S-') =, and r[S S-'] = 0. If e(S') > O, then (S',x') is a strong witness.

" ""'' ";`'' "" '' ""

We will apply the preflow-push algorithm until it terminates or until the numb array contains a gap. If the numb array contains a gap, then the witness S can be replaced by S', which is a subwitness, so that the corresponding numb array has no gap. We depict an execution of the preflow-push algorithm by procedure preflow-push(x, S, d, w, success, S), which takes as an input a set S of nodes, a preflow x, a sink (target) node w E S, valid distance labels d(i) with respect to node w, and attempts to send all the excess residing at nodes in S to node w. If the procedure succeeds in its task, then it outputs the final preflow x, success is set to true, and S' is left undefined. If the procedure does not succeed in its task of sending flow to the target node, then it outputs a strong witness (S',x) with S' S \ w} and success is set to false. We give an algorithmic description of the preflow-push procedure in Fig. . The procedure repeatedly selects an active node u in S (other than node wt) and applies

----

--- IL1·--e --- I ---C--- -

C C. Aggarwal et a. / Mcathematical Programming81 (1998) 263-280

269

procedure preflow-push(x, S, d, w, success, S');

begin success: = true;

while (success = true) and there is an active node u E S\ (w} do push/relabel(u); end; (a)

"' ''""' .. .. ......:.. "'"" ''""'""" '........ '' '.-,..... ' ":::....... ' "' '`.:....:. "' " "'.. .... "

procedure push/relabel(u); begin if the network contains an admissible arc (u, v) then

push min{e(u), rv} units of flow on arc (u, v) else replace d(u) by minfd(v)+l : (u, v) e A(u) and ruv > 0); update the array numb; if numb contains a gap at position d(u) - 1 then success = false and S'= i

S: d(i) > d(u)- 1};

end; (b) Fig. 1. The preflow-push procedure.

the procedure pushlrelabel(u). The procedure push/relabel(u) pushes flow out of node u on admissible arcs, and when no admissible arc emanates from node u, it relabels

node u (that is, increases its distance label). The preflow-push procedure tries to push the excess residing at nodes on S to

node w using admissible arcs. It will be shown in Section 4 that in all executions of the preflow-push procedure except for the first one, (S,x) is a strong witness. Therefore, no flow can be sent from nodes in S to nodes in S-. Correspondingly, nodes in S- are completely ignored in the preflow-push procedure. Our convention is that d(i) =

for all i c S-. With this convention, all arcs emanating from nodes in

S- satisfy the validity conditions. The preflow-push procedure terminates according to one of the two following

'' "

cases. Case 1: success - true. In this case, the procedure succeeds in sending all the excess residing at nodes in S to node w. Case 2: success -false. Let d ) denote the distance labels at the time of termination. In this case, the procedure identifies a gap in the numb array, say at position p.

Let 5' = i: d(i) > p}, and let node h be the node whose relabel creates a gap in the numb array. Since the algorithm always examines active nodes and the gap is created by the increase in the distance label of h, it follows that e(h) > 0 and h E S'. There-

fore, e(S') > 0. Property 2 implies that (S',x) is a strong witness. Since d(w) - O w SS'; therefore, S' c S \ {w}. To summarize, in this case, the preflowpush procedure discovers a subwitness S' of S not containing node w.

I.__l__L---

270

C C Aggarwal et a.

Mathematical Programmning 81 (1998) 263-280

In this paper, we shall use the following properties of the preflow-push procedure,

whose proofs can be found in [6,9]. Property 3. (a) The prefiow-push procedure maintains valid distance labels at each step. (b) The preflow-push procedure relabels ny node at most n times. The worst-case running time of the preflow-push procedure depends on how the active node in S are examined. If the procedure examines the active nodes in S in the first-in first-out order, then the procedure runs in O(n3 ) time. If the procedure always examines an active node with the highest distance label in S, then the procedure runs in O(n 2 m) time (see [1]). Using the dynamic tree data structure, both the procedures can be implemented in O(nm log (n'l2 /m)) time (see [9]).

-.·' ·, · ·· · ·. ·-· '' ' ' `' :· ·

4. The minimal witness algorithm In this section, we describe an algorithm to identify a minimal witness in a net-

work. We show that we can identify a minimal witness by solving a sequence of at most n maximum flow problems. An improved implementatioh of this algorithm will be described in Section 5. Our minimal witness algorithm always maintains a strong witness (5,x). The algorithm obtains the initial strong witness by solving a maximum flow problem.

Let x be a maximum flow in G and [S, S-] be a minimum cut in G. It can be easily verified that x is a preflow in G and (S, x) is a strong witness (because, by our earlier assumption (1) does not possess a feasible flow). The set S is a witness but may not be a minimal witness; that is, it may contain proper subwitnesses. We say that a node i is compulsory in the witness S if every subwitness of S contains node i. The following property is immediate from this definition and the definition of minimal witness. Property 4. A witness S is a mzinimal witness if and only if every node of S is compulsory. Given a strong witness (S, x), our algorithm examines each node w E S one by one and checks whether node w is compulsory or not. If node w,is not found to be compulsory, then the algorithm obtains a set S' C S \ {w}, which then replaces S. The algorithm terminates with a set S in which every node is compulsory. The algorithm uses the following two properties to determine the correct status of nodes.

.;·;.... ..,·.` .. ··..·. ·-.. .. " .·..

Property 5. Suppose that x is a prefiow and S is a set of nodes satisfying e(i) = Ofor every i E S. Then neither S nor any of its subsets can be a witness.

Proof. Suppose that S' c S. Then e(S') = 0, and r[S',S-'] > 0 because residual capacities of arcs are non-negative. It follows from Property

~~~~~~--~~~~~~-1 111 11 ~ ~ ~ ~ ~ ~ I-

-111

11~~~~~~~~~-~~~~

-

"0

that S' is not a witness.

-

C C. Aggarwal et al. / Mathematical Programming 81 (1998) 263-280

271

Property 6. Suppose that (Sx) is a strong witness, and w is the only node in S with positive excess. Then, node w is a compulsory node in S. Proof S is a witness, and by Property 5 no subset of S \ w} is a witness. It follows that node w is compulsory in S. C

To check whether a node w is compulsory or not, we apply the procedure preflowpush(x, S, d, wv, success, S'), which attempts to push the excess residing at nodes in S to node w. If the procedure succeeds in sending all the excesses to node wv,then it follows from Property 6 that node w is a compulsory node. Otherwise, it follows from our discussion in Section 3 that the procedure identifies a strong witness (S',x) with S' c S \ {w}, implying that node w is not a compulsory node. Fig. 2 gives an algorithmic description of the minimal witness algorithm. The minimal witness algorithm first applies the preflow-push procedure to obtain the initial strong witness (S,x). Observe that S < (n - 1). Subsequently, in each iteration the algorithm selects a target node w S, recomputes valid distance labels with respect to node w (by performing a backward breadth-first search from node

''

r ···- ·;···-b,,c, -· ·.·J.·· ·.·-r.·.· .-, r.··F··' -I· rl;·r; r .· , · Itr· I·'I·-· · :1.. I* · I·\.I) '·

algorithm minimal-witness; begin set S: = N and w: = t;

set x: = 0 and compute valid distance labels d; preflow-push(x, S, d, w, success, S'); S: = S';

(Comment: (S, x) is the initial strong witness) unmark all nodes in S; while there is an unmarked node in S do begin select an unmarked node w e S (called the target node); preprocess-I(w); preflow-push(x, S, d, w, success, S'); if success = true then mark node w as compulsory else replace (S, x) by (S', x); end; end; .·,...."'..·;" ....: " ..

C·:i

(a)

' ' ' " : ' ''

procedure preprocess-I(w); begin set d(w) : = 0; compute valid distance labels from node w; end; (b) Fig. 2. The minimal witness algorithm.

I~~

~~~~~--·r ---·P -

.T---·

.~~~~~~ -

IN~

--

--- ·

.

272

C. C Aggarwal et cl. / Mathematical Programming 81 (1998) 263-280

w), and uses the preflow-push procedure to determine whether node w is compulsory.

The algorithm either marks node w as compulsory or strictly reduces the size of S. Overall the preflow-push procedure is applied at most n times. At the termination of the algorithm, the set S is a witness and each node in it is proven to be compulsory, implying that the set S is a minimal witness. We have established the following theorem. Theorem 1. The minimal itness algorithm determines a minimal witness of G by applying the prefiow-push procedure at most n times.

.::.::-. .:.-

5. The improved minimal witness algorithm In this section, we develop an improved implementation of the minimal witness algorithm described in the previous section. The running time of the improved implementation is comparable to the time taken by a single application of the maximum flow algorithm. The improved algorithm uses two important ideas: (i) an application of the preflow-push procedure reuses the distance labels of the previous application

of the procedure; and (ii) it periodically contracts the nodes. Contraction plays a crucial role in the improved minimal witness algorithm. The algorithm occasionally contracts two compulsory nodes into a single node. Contracting two nodes p and q in the residual network G(x) into a single node k consists of

the following steps: (i) replace each arc (i,p) or (i,q) by the arc (i,k); (ii) replace each arc (p,i) and (q,i) by the arc (k,i); (iii) combine parallel arcs into a single arc with residual capacity (and flow) equal to the sum of the residual capacities (and flows) of the parallel arcs; (iv) set b(k) = b(i) + b(j); (v) set e(k) = e(i) + e(j); and (vi) elimi-

nate loop arcs (that is, arcs of the type (k,k)). Using simple data structures, the above steps can be implemented in O(n) time per contraction. Let GC = (NC, AC) denote the resulting network when two compulsory nodes i and j of S are contracted into a single node k. For any set Q C N containing nodes i and j, we denote by Q {k} U Q \ i,j}. Property 7 shows that the contraction of two compulsory nodes does not have any effect on the subwitnesses of a witness. Property 7. Suppose that nodes i andj are compulsory in a witness S and are contracted

Proof Assume first that is a subwitness of S. Since nodes i and] are compulsory in S, any subwitness R of S must contain nodes i andj. Now observe that b(R) - b(RC), because b(k) b(i) + b(j). Also observe that u[R,R-]J = u[R, R-1, because for each arc (u, v) E [R,R-] there is a corresponding arc in [RC, R - c] with the same capacity. Since b(R) > u[R,R-] it follows that b(RC) > u[RC,R-C], and so R is a witness. Conversely, assume that R is a subwitness of SC, and let R be obtained by expanding

C C Aggarwal et al. / Mathematical Programming 81 (1998) 263-280

node k of RC into nodes i and j. Then b(R) = b(RC) and u[R,R-]

273

= u[RCR-C].

b(RC) > u[RC,R-C], it follows that b(R) > u[R,R-], and so R is a witness.

Since

1

The following corollary of Property 7 can be easily proved. Property 8. A node w compulsory for SC in

g

i, j is compulsory for a witness S of G if and only if

t

is

G0.

The improved minimal witness algorithm is the same as the algorithm given in

"'··,·· · -.·i· ·· r· ··.. i·· i· -·L-··:· rlI··_L·C. -1-· -· -· ··L··1 i· YI'-.· ··- ·1 U · )_ ····--·····

Fig. 2 except the following changes. Change : Select an unmarked node in S with the minimum distance label as the

target node. Change 2: Replace the procedure preprocess-Iby the procedure preprocess-IIgiven below. procedure preprocess-II(w), begin for each node i

S do d(i) := max{d(i) - d(w), O};

for each node i of S-, d(i) := 0; contract all compulsory nodes of S with zero distance labels into a single node; end.

;·.·· ······ i.T1 · .:j 1 I · L O-·--· ·I- I L I.. : '·.""..' '··'- '-'·. '··"·I'·i· *'' '' ··r- -··'·: ·-- ·····. ·· i

Change 3: At the termination of the algorithm, expand the contracted (compulsory) nodes to obtain a minimal witness in G. With these changes, the minimal witness algorithm runs as follows. The algorithm first applies the preflow-push procedure to obtain the initial strong witness (S,x). Subsequently, in each iteration the algorithm selects an unmarked node w e S with the smallest distance label as a target node, uses the preflow-push procedure to send all the excess residing at nodes in S \ {w} to node w. The preflow-push procedure terminates when either all the excess is pushed to node w (implying that node w is a compulsory node) or the procedure discovers a gap in the numb array (implying that node w is not a compulsory node). In the latter case, the algorithm replaces S by a smaller set S', selects a new target node w E S, updates all distance labels d(i) to max{d(i) - d(w), 0, and contracts all nodes with zero distance labels into a single node. (Observe that all nodes with distance labels below the gap are contracted into a single node and the numb array corresponding to the contracted network has no gap.) The algorithm repeats this process until the status of each node is correctly determined. At this point, the algorithm expands the contracted (compulsory) nodes to determine a minimal witness in G. Change is a specialization of the previous algorithm, and so maintains the correctness of the algorithm. By Properties 7 and 8, the contraction of compulsory

-`I`--------------------C----------r-

___----T-I---

9P-- --- --rr·---·l----------·--·--·-x_

274

C.C. Aggarwal et al. / Mathematical Programing81 (1998) 263-280

nodes in Change 2 also maintains the correctness of the algorithm, and contracting compulsory nodes with a common distance label maintains the validity conditions. To establish that the algorithm is correct with respect to Changes 1-3, we now establish that the change of distance labels in Change 2 maintains the validity of the distance labels. We remark that it is the reuse of the distance labels that is the key idea that leads to the speedup in the running time of the algorithm. Lemma 2. The procedure preprocess-II(w) maintains the validity of distance labels. ''

Proof The procedure preprocess-II(w) modifies distance labels of each node i E S as d'(i) = max{O, d(i) - d(w)}, and d'(i) =O for i B S. Suppose that d ) satisfies the validity conditions, and that (ij) G G(x). Then d(i) d) + . If i C 5, then j E S, then d'(i) = max(0, d(i) - d(w))- I + max(0, d(j) - d(w)) = d'(j), and so (i,j) maintains the validity conditions with respect to d'( ). If i 0 5, then d'(i) = 0, and the validity conditions are also satisfied. The procedure preprocess-IJ(w) also contracts compulsory nodes with zero distance labels. Since contracted nodes have the same distance label, contraction does not affect the validity of distance labels. This completes the proof of the lemma. : We next bound the total number of relabels of any node. Lemma 3. In the entire execution of the iproved minimal witness algorithm, the preflow-push procedure relabels any node at most 3n timnes.

''' ''

Proof. During the execution of the minimal witness algorithm, distance labels of nodes increase during relabels, and they may decrease during executions of the procedure preprocess-II. The total increase in the distance label of any node i is bounded by the total decrease in the distance label of the node plus the maximum possible distance label of node . Since d(i) < n (for otherwise the numb array must contain a gap), it follows that the total increase in the distance label of any node i is bounded by n plus the total decrease. We now obtain a bound on the total decrease in the distance label of any node in the procedure preprocess-II. We will show that the total decrease in distance labels for node j is bounded above by 2n. (Here we will ignore the decrease in distance labels for nodes not in S, since the distance label of a node not in S cannot increase further.) Consider an execution of the preflow-push procedure in which the node set S is the current witness and w is the target node. Let d denote the distance labels at the end of the iteration, immediately prior to selecting the next target node. At the next iteration, let S' denote the witness, w denote the target node, d' denote the distance labels. Then d'(j) = max(0, d(i) - d(w')) for j £ S. Therefore, the distance label of node may decrease by as much as d(w'). We now claim that

Iqa

_____----,

·I

_ _ .. ,._

_

_

C.C. Aggarwal et al. / Mathematical Programming81 (1998) 263-280

·.,:.· ··-;···--······ · .;···, ·.·· "" .-*.- -·"---"··"' ... i

275

IS - S'I > d(w') - 2. If the claim is true, then the decrease in the distance label at an iteration is at most two greater than the decrease in the size of the witness. Summing over all iterations, the decrease in distance labels is at most the two times the number of iterations plus the size of the initial witness, and this is bounded by 3n. So if the claim is true, then the lemma is true. It remains to show that ISI - S'I > d(w') - 2. Prior to the call of subroutine preprocess-II there were nodes in S with labels 0, 1,... d(') - I, with the possible exception of a single gap. Let S* denote this subset of nodes. Then S* c S and S*i 3 d(w') - . Subsequent to the call of subroutine preprocess-II, S* is either entirely eliminated (because it is below the gap cut) or else a subset may be eliminated and the remainder contracted into a single node. (The nodes that are contracted are all compulsory, and these are contracted into a single node.) In either case, S* is replaced by either a single node or eliminated, giving us the inequality II < SI - S*I + 1. Substituting S* d(w') - in this inequality gives SI - S'I d'(w) - 2, completing the proof of the lemma. E We remark that a more careful argument can reduce the number of relabels of a node from 3n, but the asymptotic time bounds will not be affected. We are now in a position to determine the worst-case complexity of the improved minimal witness algorithm. We have seen earlier that the algorithm performs at most n iterations. Each iteration of the algorithm takes O(n) time plus the time taken by contractions and the preflow-push procedures. Since each contraction takes O(n) time, and there are at most n contractions over all, the total time for contractions is bounded by O(n 2 ). The total time taken by different executions of the preflow-push procedure depends upon the number of relabels of nodes. As long as each node is relabeled O(n) times, Goldberg and Tarjan's analysis [9] shows that the FIFO implementation of the preflow-push algorithm would take 0(n3 ) time. Cheriyan and Maheshwari's analysis [11] shows that the highest distance label implementation would take (n2 /m) time. We summarize our discussion in this section as follows.

`'"''

r-;-.·1·. ..;-:::.;:i......·-._ ffi'··:; "·'·.·· "

.-------.

----

-^------g___CCI···*P-qsF

Theorem 2. The improved minimal witness algorithm correctly identifies a minimal witness in a network (i) in O(n3 ) time using FIFO implementation, and (ii) in O(n2 in) time using the highest distance label implementations. Sleator and Tarjan [12] developed the dynamic tree data structure, which can be used to implement our minimal witness algorithm in an amortized time of O(log n) per basic operation, and in O(nm log n) time overall. Goldberg and Tarjan [9] have shown that by using the dynamic tree data structure, the preflow-push algorithm for the maximum flow problem can be implemented in O(nm log (n2/m)) time, a factor log n improvement for fully dense graphs. We conjecture that using the dynamic tree data structure, the improved minimal witness algorithm can also be implemented in O(nm log (n2 /m)) time.

-·-C

---

-I

-----

·

r-·-C

__

__

276

Mathematical Programming81 (1998) 263-280

C. C. Aggarwal et al.

6. Equivalence of recognition versions of the minimal witness problem and the minimum rooted cut problem In this section, we show that a recognition version of the minimal witness problem is equivalent to the recognition version of a related problem known as the minimum rooted cut problem. The minimum cut problem is the problem of selecting a subset S of nodes in a directed (or, undirected) network so that u[S, S-] is minimum. The minimum rooted cut problem is the problem of selecting a subset S of nodes containing a specified root node s that u[S, S-] is minimum. The well known minimum s-t cut problem is a further restriction where we want to select a subset S of nodes such that s E S t S-) and u[S, S-] is minimum. Hao and Orlin [7] show how to solve the minimum cut problem by solving two minimum rooted cut problems. They further show, using an approach similar to the one pursued in this paper, how to solve each minimum rooted cut problem as a sequence of 0(n) maximum flow problems in the time it takes to solve a single maximum flow problem. We establish a connection between the minimum rooted cut problem with the minimal witness problem by showing the equivalence between their recognition versions.

''"""

Minimum rooted cut problem - Recognition version Input: A directed network G = (N,A), arc capacities uij, a root node s, and a subset S of nodes containing node s. Question: Is the cut [S, S- a minimum rooted cut in G? Minimal witness problem - Recognition version Input: A directed network G = (NA), arc capacities ui's, a supply/demand vector b(i), and a strong witness (S,x). Question: Is the witness S a minimal witness in C? We remark that these are not the standard formulation of the recognition versions. Perhaps a better term would be "verification version" of the problem, since the question is whether a specified solution is optimum. Theorem 3. The recognition versions of the miinizal witness problem and the minimum

rooted cut problem are equivalent.

i

..r

Proof. Consider a recognition version of the minimum rooted cut problem in the network CG, arc capacities ujiis, a node s, and a set S containing node s. We first show that this problem can be transformed to the recognition version of the minimal witness problem. Let G' (N', A') be created from G by letting N' N U {t} and A'-A. Capacities of arcs in A' are the same as those in A. We let b(s) = u[S,S-], b(t) - u[S,S-], and b(i) = 0 for every other node i. Observe that node t has no incident arc in A'. Let x = (xj), where xj = 0 for all arcs in G'. Then, (N, x) is a strong witness of G'. Observe next that any rooted cut [R, R-] of capacity

~~~-~~~ -~~~~~~~....- ~~~~~~~~1.1~~~~~---`~~~~~~~~-~~~~------ - O·T----·-·--aC ·--

·--

~ ~~

-·*--·I-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-~~~----

C C. Aggarwal et al. / Mathematical Programming 81 (1998) 263-280

.r .., .. -._·.·..··· :· ·-..

o,

.... .Y .. ·."".: -·. `:'· -··':· "" ·

Ir.

277

less than [S, S-] induces a subwitness R of N showing that N is not a minimal witness of G'. Similarly, any minimal witness R of N' has the property that u[R,R-] is a rooted cut with capacity less than b(s) = [S, S-]. It follows that N is a minimal witness of G' if and only if [S, S-] is a minimum rooted cut of G. We now show that the recognition version of the minimal witness problem is a special case of the recognition version of the minimum rooted cut problem. Let (S,x) denote the strong witness. Without loss of generality, assume that x = 0. (Equivalently, we focus on the residual network.) In this case, b(i) Ž Ofor each node i in S, b(j) > for some node j in S, and there is no arc directed from a node in S to a node in S-. We first consider the special case in which b(s) > Ofor some s c S, and b(i) for i C S and i s. We refer to node s as the root node. In this case, we claim that S is a minimal witness of G if and only if the minimum rooted cut in G has value at least b(s). To see that the claim is true, suppose first that there is a cut [R, R-] with capacity less than b(s). Notice that any reasonable cut [R, R-] with capacity less than b(s) must be a proper subset of S. Suppose conversely that there is a proper subwitness R of S. Then, u[RR] < b(s). This establishes the claim. We now consider the remaining case in which more than one node of S may have excess. Now create the network G' = (N', A') by letting N' = N U {s}, and by adding the arc (s, i) of capacity b(i) for each node i S with b(i) > O. We let b'(s) = b(S), and b'(j)- 0 for j E S. Let x denote the flow which is identical to zero. Observe that (S U {s}, x) is a strong witness in G; further, it is a minimal witness in G' if and only if S is a minimal witness in G. Finally, we observe that this case reduces to the case above in which only one node of the strong witness has excess. This completes the proof. Despite the equivalence of these recognition versions of the minimal witness problem and the minimum rooted cut problem, it does not appear that the minimal witness problem is a special case of the rooted minimum cut problem, nor does it appear that the rooted minimum cut problem is a special case of the minimal witness problem. These two problems seem to require slightly different algorithms. Moreover, the algorithm and the analysis for the minimal witness problem described in this paper is somewhat simpler that Hao and Orlin's algorithm for the minimum rooted cut problem. We leave it as an open question whether using ideas contained in this paper, the algorithm for the minimum rooted cut problem can be further simplified.

7. Conclusions In Appendix A, we show that the problem of determining a minimum cardinality witness in NP-hard. We have shown that the problem of determining a minimal witness can be solved as a sequence of n maximum flow problems, and that the total

----'--I---- -`------------------""L"e·clrrrrr-r

-I

---------- --q -rre

-is-·s-ePI----- cl

------r-----c--

--------- - --

--

278

- ·. ·· ·r·,.· s· r··· · ,-r. ·r··-i ·,c ·r· i. · ···r·rh·· r ·r ··';·-·*·- ···-I.·i.·: ···-:·.· . i. r-r·c··lrr n· -·.r .·....

C C Aggarwal et al / Mathematical Programming81 (1998) 263-280

running time of these n problems is nearly comparable to the time needed to solve a single maximum flow problem. The primary contribution of this paper is theoretical, that is, we develop an improved worst-case running time for finding a minimal witness. Nevertheless, we are optimistic that the algorithm will perform well in practice. Perhaps the algorithm of this paper could be a core component of a system that permits users to explore different witnesses, with the user specifying certain subsets to be included in or excluded from the witness. The issue of identifying minimal witnesses also raises questions concerning the interpretation of the witness in the context of the model and the correction of the infeasibilities. Here we only raise the issue since it is well beyond the scope of this paper. Greenberg [4], who uses the word "isolation" rather than "witness", writes: "An isolation is a portion of the linear program obtained in some purposeful way to contain a probable cause. A diagnosis [of the infeasibility] additionally requires an explanation of an isolation, which can require complex reasoning". We refer the reader to [4] for further discussion on the use of witnesses in diagnoses.

Acknowledgements This research was partially supported by ONR contract N00014-94-1-0099 and also a grant from the UPS foundation. We sincerely thank the referees for their insightful comments.

Appendix A

r""':··

· 'r·;·,·· ··· ",··". -';

"---^-

'.'· ..·'

---"I--I-`------\-e31"·3"as

In this appendix, we prove the NP-completeness of the minimum witness problem in directed networks. The decision version of the minimum witness problem is the kwitness problem defined as follows. k- Witness problem: Given a directed network G (N, A) with associated supply! demand vector b, and an arc capacity vector u, does there exist a subset S of at most k nodes satisfying b(S) > [S S-]. In order to prove that the k-witness problem is NP-complete, we show that the kclique problem on a regular graph can be reduced to the k-witness problem. The version of the k-clique problem that we consider is as follows: k-Clique problem on regular graphs: Given an undirected graph G' = (N', A') in which each node in Nt has exactly p arcs incident to it, does there exist a subset C C N' containing exactly kI nodes such that every pair of nodes i and j in C is connected by an arc in A'? It is well known that the clique problem is NP-complete. We point out that the clique problem is NP-complete even if it is restricted to regular graphs. Garey and Johnson [13] show that the independent set problem on a cubic planar graph is

I-·P

C C Aggarvall et al. / Mathematical Programming 81 (1998) 263-280

279

NP-complete (a planar graph with exactly three incident arcs on each node is called a cubic planar graph). The independent set problem on a graph is equivalent to the clique problem on its complement. Consequently, the independent set problem on a cubic planar graph G is equivalent to a clique problem on the complement of G, say G'. But since G is regular, G' is also regular, establishing that the clique problem on a regular graph is also NP-complete. Theorem A.i. The k-witness problem is NP-complete. Proof. Let G' = (N', A') be an undirected graph in which each node has degree p and in which we wish to solve the clique problem. We will show that the equivalence of

" ' ' ''""'' ':'' '''`

this problem with the witness problem on an associated graph G = (N, A) defined in the following manner. Define the node set N = N' + {s, t}. For each node i E N', define an arc (s,i) in A with sufficiently large capacity B. For each arc (ij) E A', introduce two arcs (ij) and (i) in A, each with capacity 1. Finally, define the supply/demand vector b as b(s) = -b(t) = B(n - K) + K(p - K + 1) + 1, and b(i) = 0 for all other nodes i.

We will now show that

has a clique of size K if and only if ; has a witness of

size at most K + 1. This will establish the equivalence between the clique problem and the witness problem. Suppose first that G' has a clique C of size at least K. Let S = C + {s}. Then, u[S, S-] = B(n - K) + K(p - K + 1).

(A.1)

In (A. 1), the term B(n -K) is contributed by the capacities of arcs (sj) for nodes that are not in C; and the second term is contributed by the unit

capacity arcs going from the node set C to the node set N \ C and we use the fact that each node in C has exactly p incident arcs of which (K - 1) arcs

connect to the other nodes in C and (p- K + ) arcs connect to the nodes in N \ C. It follows that u[S, S-] < b(S) = b(s) = B(n - K) + K(p - K + 1) + 1. This completes the proof that if G' has a clique of size K, then G has a witness of size K + 1. Now suppose that G has a witness S of size at most K + 1. Clearly, node s is in S. Let C = S - {s}. IfCJ •CK - 1, then u[S, S-] > B(n - K + 1) > b(S) = b(s) (here the latter inequality holds because B is a sufficiently large number), and therefore S would not be a witness. It follows that IS = K + I and CI = K. Let m' be the number of arcs in G with both endpoints in C. Then,

.····.·""'"" · '';'''` 4,....... -. ...... ....··.· ·-.-..··.

u[S,S-] =B(n-K)+pK-m'

Suggest Documents