• Nem Talált Eredményt

3 Algorithm for the Maximum Partition Problem

The main result of the paper is the following theorem.

Theorem 1 The maximum partition problem can be solved for any series-parallel graph G in time O(m4sn), where n is the number of vertices in G and msis the maximum supply.

In the remainder of this section we give an algorithm to solve the maximum partition problem in time O(m4sn)as a proof of Theorem 1.

We partition a series-parallel graph G into connected components by deleting edges from G so that (a) each component contains at most one supply vertex; and

(b) if a component C contains a supply vertex, then the supply is no less than the sum of demands of all demand vertices in C.

Such a partition P is called a partition of G. The fulfillment f(P)of a partition P is the sum of demands of all demand vertices in components with supply vertices. Thus f(P)corresponds to the maximum sum of all loads that are supplied electrical power from feeders through a network reconfigured by cutting off some edges. The maximum partition problem is to find a partition of G with the maximum fulfillment. The maximum fulfillment f(G)of a graph G is the maximum fulfillment f(P)among all partitions P of G. For the graph G in Fig. 1 the partition P indicated by thin dotted lines has the maximum fulfillment, and hence f(G) = f(P) =45.

Every partition P of a series-parallel graph G naturally induces a partition P0of its subgraph Gufor a node u of a binary decomposition tree T of G. The induced partition P0 can be classified into two types of partitions, called a “connected partition” and a “separated partition,” which are illustrated in Fig. 4 and will be formally defined later. If a component of P0with a terminal contains a supply vertex, then the component may have the “marginal” power, the amount of which is no greater than ms. Otherwise, the component may have the “deficient” power, the amount of which should be no greater than ms. Thus we later introduce two functions g :( ,Zms)→Z+and h :( ,Zms,Zms)→Z+, where denotes the set of all series-parallel graphs,Z+denotes the set of all nonnegative integers, andZms denotes the set of all integers whose absolute values are no greater than ms. For Guand i,j,k∈Zms, the values g(Gu,i)and h(Gu,j,k)represent the maximum fulfillment of Guin a connected partition and in a separated partition of Gu, respectively, and i, j and k represent the amount of “marginal”

or “deficient” power in a component with a terminal. Our idea is to compute g(Gu,i)and h(Gu,j,k)from the leaves of T to the root r of T by means of dynamic programming.

We now formally define the notion of connected and separated partitions of a series-parallel graph G. Let P be a partition of a subgraph Guof G for a node u of a binary decomposition tree T of G, and let vs=vs(Gu)and vt=vt(Gu). Let C(P,vs)

TAKEHIROITO, XIAOZHOU, TAKAONISHIZEKI 117

be the set of all vertices in the component containing vs, and let C(P,vt)be the set of all vertices in the component containing vt. If C(P,vs) =C(P,vt), that is, the two terminals vs and vt are contained in the same component of P, then we call P a connected partition of Gu. (See Fig. 4(a).) If C(P,vs)6=C(P,vt), that is, the two terminals vs and vt are contained in the different components of P, we call P a separated partition of Gu. (See Fig. 4(b).)

We then classify both connected partitions and separated partitions further into several classes. The “power flow” around a terminal depends on whether the terminal is a supply vertex or a demand vertex. Since we want to deal with the two cases uniformly, we introduce a graph Gufor a subgraph Guof G; let Gube a graph obtained from Guby regarding each of the two terminals vs(Gu)and vt(Gu)as a demand vertex whose demand is zero. It should be noted that a partition of Guis not always a partition of Gu. Let Ginu be the graph obtained from Guby deleting the two terminals vs(Gu)and vt(Gu). Let Goutu be the graph obtained from G by deleting all the vertices of Guexcept vs(Gu)and vt(Gu).

If P is a connected partition of Gu, then C(P,vs) =C(P,vt)and we denote it simply by C(P). For each integer i∈Zms, we call P an i-connected partition of Guif P satisfies the following two conditions (a) and (b):

(a) if i>0, then C(P)contains a supply vertex w and i+∑xC(P)−{w}dem(x)≤sup(w); and (b) if i0, then C(P)contains no supply vertex and∑xC(P)dem(x)≤ |i|=−i.

Note that P is an(i−1)-connected partition if P is an i-connected partition unless i=1. An i-connected partition P of Gu with i>0 corresponds to a partition of the whole graph G in which all demand vertices in C(P)are supplied power from a supply vertex w in Ginu; an amount i of the remaining power of w can be delivered to Goutu through vs(Gu)and vt(Gu); and hence the “margin” of C(P)is i. An i-connected partition P of Guwith i0 corresponds to a partition of G in which all (demand) vertices in C(P)are supplied power from a supply vertex in Goutu ; an amount|i|of power must be delivered to Ginu through either vs(Gu)or vt(Gu), and hence the “deficiency” of C(P)is|i|. For an i-connected partition P of Gu, let

f(P,i) =

f(P) if 0<ims, f(P) +∑xC(P)dem(x) if−msi≤0.

Thus f(P,i)with−msi0 represents the fulfillment of P when an amount|i|of power is delivered to Ginu from a supply vertex in Goutu .

For each pair of integers j and k inZms, we call a separated partition P of Gua(j,k)-separated partition if P satisfies the following four conditions (a), (b), (c) and (d):

(a) if j>0, then C(P,vs)contains a supply vertex w and j+∑xC(P,vs)−{w}dem(x)≤sup(w);

(b) if j0, then C(P,vs)contains no supply vertex and∑xC(P,vs)dem(x)≤ −j;

(c) if k>0, then C(P,vt)contains a supply vertex w and k+∑xC(P,vt)−{w}dem(x)≤sup(w); and (d) if k0, then C(P,vt)contains no supply vertex and∑xC(P,vt)dem(x)≤ −k.

A(j,k)-separated partition P of Guwith j>0 corresponds to a partition of the whole graph G in which all demand vertices in C(P,vs)are supplied power from the supply vertex w in Ginu; an amount j of the remaining power of w can be delivered to Goutu through vs(Gu), and hence the margin of C(P,vs)is j. A(j,k)-separated partition P of Guwith j≤0 corresponds to a partition of G in which all (demand) vertices in C(P,vs)are supplied power from a supply vertex in Goutu ; an amount|j| of power must be delivered to Ginu through vs(Gu), and hence the deficiency of C(P,vs)is|j|. Similarly, a(j,k)-separated partition P of Guwith k>0 corresponds to a partition of G in which all demand vertices in C(P,vt)are supplied power from the supply vertex w in Ginu; an amount k of the remaining power of w can be delivered to Goutu through vt(Gu), and hence the margin of C(P,vt)is k. A(j,k)-separated partition P of Guwith k0 corresponds to a partition of G in which all (demand) vertices in C(P,vt)are supplied power from a supply vertex in Goutu ; an amount|k|of power must be delivered to Ginu through vt(Gu), and hence the deficiency of C(P,vt)is k. For a(j,k)-separated partition P of Gu, let

f(P,j,k) =







f(P) if 0<j,kms,

f(P) +∑xC(P,vt)dem(x) if 0<jmsand−msk≤0, f(P) +∑xC(P,vs)dem(x) if−msj≤0 and 0<kms, f(P) +∑xC(P,vs)C(P,vt)dem(x) if−msj,k≤0.

Thus f(P,j,k)with nonpositive j or k represents the fulfillment of P when an amount|j|or|k|of power is delivered to Ginu from a supply vertex in Goutu through vsor vt.

We now formally define a function g :( ,Zms)→Z+for a series-parallel graph Guand an integer i∈Zms, as follows:

g(Gu,i) = max{f(P,i)|Guhas an i-connected partition P}.

If Guhas no i-connected partition, then let g(Gu,i) =−∞. We then formally define a function h :( ,Zms,Zms)→Z+for a series-parallel graph Guand a pair of integers j and k inZms, as follows:

h(Gu,j,k) = max{f(P,j,k)|Guhas a(j,k)-separated partition P}. If Guhas no(j,k)-separated partition, then let h(Gu,j,k) =−∞.

118 TAKEHIROITO, XIAOZHOU, TAKAONISHIZEKI Our algorithm computes g(Gu,i)and h(Gu,j,k)for each node u of a binary decomposition tree T of a given series-parallel graph G from the leaves to the root r of T by means of a dynamic programming. Since G=Gr, one can easily compute the maximum fulfillment f(G)from g(G,i)and h(G,j,k)in time O(1).

We first compute g(Gu,i)and h(Gu,j,k)for each leaf u of T , for which Gu contains exactly one edge. Since the two terminals of Guare demand vertices of demands zero,

g(Gu,i) = O(ms)and O(m2s), respectively. Since G is a simple series-parallel graph, G has at most 2n−3 edges and hence T has at most 2n3 leaves. One can thus compute g(Gu,i)and h(Gu,j,k)for all leaves u of T in time O(m2sn).

We first compute h(Gu,j,k). Every separated partition P of Gucan be obtained by combining a separated partition P1of G1with a separated partition P2of G2, as illustrated in Fig. 5(a). We can thus know that, for each pair(j,k), h(Gu,j,k)can partition P2of G2, as illustrated in Figs. 5(b) and (c). There are the following two Cases (a) and (b) to consider, and we define the two functions ga(Gu,i)and gb(Gu,i)for the two cases, respectively.

Case (a): both P1and P2are connected partitions. (See Fig. 5(b).) We define ga(Gu,i)for each integer i∈Zms, as follows:

ga(Gu,i) = max

i1,i2{g(G1,i1) +g(G2,i2)} (4)

where the maximum is taken over all integers i1and i2such that

TAKEHIROITO, XIAOZHOU, TAKAONISHIZEKI 119

G1*

G2*

vs

vt

i2

i1 v

G2*

vs

vt k2

j2

i1 v

G1*

G1*

G2* vs

vt k1

j1

v

k2

j2

(a) (b)

(c)

Figure 6: The combinations of a partition P1of G1and a partition P2of G2for a partition P of Gu, where Gu=G1G2. (a) i1,i2∈Zms;

(b) i1+i2=i;

(c) if i0, then i1,i2≤0; and

(d) if i>0, then exactly one of the two integers i1and i2is positive.

Case (b): one of P1and P2is a separated partition and the other is a connected partition.

One may assume without loss of generality that P1is a separated partition and P2is a connected partition. (See Fig. 5(c).) We define gb(Gu,i)for each integer i∈Zms, as follows:

gb(Gu,i) = max

j1,k1,i2{h(G1,j1,k1) +g(G2,i2)} (5) where the maximum is taken over all integers j1, k1and i2such that

(a) j1,k1,i2∈Zms; (b) j1+k1+i2=i;

(c) if i0, then j1,k1,i2≤0; and

(d) if i>0, then exactly one of the three integers j1, k1and i2is positive.

From gaand gbabove, one can compute g(Gu,i)as follows:

g(Gu,i) = max{ga(Gu,i),gb(Gu,i)}. (6) We next consider a series connection.

[Series connection]

Let Gu=G1G2, and let v be the vertex of G identified by the series connection, that is, v=vt(G1) =vs(G2). (See Figs. 2(b) and 6.) We define sd(v)as follows:

sd(v) =

sup(v) if v is a supply vertex,

−dem(v) if v is a demand vertex For convenience’ sake, we define dem(w) =0 for each supply vertex w in G.

We first compute g(Gu,i). Every connected partition P of Gucan be obtained by combining a connected partition P1of G1 with a connected partition P2of G2, as illustrated in Fig. 6(a). Therefore g(Gu,i)can be computed for each integer i∈Zms, as follows:

g(Gu,i) = max

i1,i2{g(G1,i1) +g(G2,i2) +dem(v)} (7) where the maximum is taken over all integers i1and i2such that

120 TAKEHIROITO, XIAOZHOU, TAKAONISHIZEKI

(a) i1,i2∈Zms; (b) i1+i2+sd(v) =i;

(c) if i0, then v is a demand vertex and i1,i2≤0; and

(d) if i>0, then exactly one of the three integers i1, i2and sd(v)is positive.

If such integers i1and i2do not exist, then we let g(Gu,i) =−∞.

We next compute h(Gu,j,k). Every separated partition P of Gucan be obtained by combining a partition P1of G1with a partition P2of G2, as illustrated in Figs. 6(b) and (c). There are the following two Cases (a) and (b) to consider, and we define the two functions ha(Gu,j,k)and hb(Gu,j,k)for the two cases, respectively.

Case (a): one of P1and P2is a connected partition and the other is a separated partition.

One may assume without loss of generality that P1is a connected partition and P2is a separated partition. (See Fig. 6(b).) We define ha(Gu,j,k)for each pair(j,k), as follows:

ha(Gu,j,k) = max

i1,j2{g(G1,i1) +h(G2,j2,k) +dem(v)} (8) where the maximum is taken over all integers i1and j2such that

(a) i1,j2∈Zms; (b) i1+j2+sd(v) =j;

(c) if j0, then v is a demand vertex and i1,j2≤0; and

(d) if j>0, then exactly one of the three integers i1, j2and sd(v)is positive.

If such integers i1and j2do not exist, then we define ha(Gu,j,k) =−∞.

Case (b): both P1and P2are separated partitions. (See Fig. 6(c).)

In this case, either(i)all demand vertices in C(P1,v)C(P2,v)are supplied power or(ii)none of them is supplied power.

For the first case(i), we define hi(Gu,j,k)for each pair(j,k)as follows:

hi(Gu,j,k) = max

k1,j2{h(G1,j,k1) +h(G2,j2,k) +dem(v)} (9) where the maximum is taken over all integers k1and j2such that

(a) k1,j2∈Zms;

(b) k1+j2+sd(v)≥0; and

(c) exactly one of the three integers k1, j2and sd(v)is positive.

If such integers k1and j2do not exist, then we define hi(Gu,j,k) =−∞.

For the second case(ii), we define hii(Gu,j,k)for each pair(j,k)as follows:

hii(Gu,j,k) = h(G1,j,0) +h(G2,0,k). (10) We then define hb(Gu,j,k)for each pair(j,k)as follows:

hb(Gu,j,k) = max{hi(Gu,j,k),hii(Gu,j,k)}. (11) From haand hbabove, one can compute h(Gu,j,k)as follows:

h(Gu,j,k) = max{ha(Gu,j,k),hb(Gu,j,k)}. (12) For each p-node u of T and all integers i,j and k inZms by Eqs. (3)–(6) one can compute g(Gu,i)and h(Gu,j,k)in time O(m3s)and O(m4s), respectively. For each s-node u of T and all integers i,j and k inZms, by Eq. (7)–(12) one can compute g(Gu,i)and h(Gu,j,k)in time O(m2s)and O(m4s), respectively. In this way one can compute g(Gu,i)and h(Gu,j,k)for each internal node u of T in time O(m4s)regardless of whether u is a p-node or an s-node. Since T is a binary tree and has at most 2n3 leaves, T has at most 2n4 internal node. One can thus compute g(G,i)and h(G,j,k)in time O(m4sn)since G=Gr

for the root r of T .

Thus the maximum partition problem can be solved in time O(m4sn). This completes a proof of Theorem 1.

4 Conclusions

In this paper we obtained a pseudo-polynomial-time algorithm to compute the maximum fulfillment f(G)of a given series-parallel graph G. The algorithm takes time O(m4sn), and hence takes polynomial time if msis bounded by a polynomial in n.

It is easy to modify the algorithm so that it actually finds a partition of a series-parallel graph.

Our algorithm for series-parallel graphs can be easily extended for partial k-trees, that is, graphs with bounded tree-width [1, 2]. The extended algorithm takes time O(m2(k+1)s n).

TAKEHIROITO, XIAOZHOU, TAKAONISHIZEKI 121

References

[1] S. ARNBORG, J. LAGERGREN ANDD. SEESE, Easy problems for tree-decomposable graphs, J. Algorithms (1991) 12 308–340.

[2] H. L. BODLAENDER, Polynomial algorithms for graph isomorphism and chromatic index on partial k-trees, J. Algo-rithms (1990) 11 631–643.

[3] M. R. GAREY AND D. S. JOHNSON, Computers and Intractability: A Guide to the Theory of NP-Completeness, Freeman, San Francisco, CA (1979).

[4] T. ITO, X. ZHOU AND T. NISHIZEKI, Partitioning trees of supply and demand, Proc. ISAAC’02, Lecture Notes in Computer Science (2002) 2518 612–623, also International J. of Foundations of Computer Science, to appear.

[5] A. B. MORTON ANDI. M. Y. MAREELS, An efficient brute-force solution to the network reconfiguration problem, IEEE Trans. on Power Delivery (2000) 15 996–1000.

[6] K. TAKAMIZAWA, T. NISHIZEKI AND N. SAITO, Linear-time computability of combinatorial problems on series-parallel graphs, J. ACM (1982) 29 623–641.

New classes of facets of cut polytope