The Uniform Generalized Decomposition Method

0 downloads 0 Views 167KB Size Report
Boolean Formulas with no Repeated Variables,. Theoretical Computer Science 66, 1989, pp. 113-. 114. [11] D. Mundici, Solution of Rota's Problem on the.
The Uniform Generalized Decomposition Method for Generating Algebraic Expressions of Fibonacci Graphs MARK KORENBLIT and VADIM E. LEVIT Department of Computer Science Holon Academic Institute of Technology 52 Golomb Str., P.O. Box 305, Holon 58102 ISRAEL

Abstract: - The paper investigates relationship between algebraic expressions and Fibonacci graphs (which give a generic example of non-series-parallel graphs). We propose the uniform generalized decomposition method for constructing Fibonacci graph expressions. On every step this method divides the graph of size n into k parts of the same size. We prove that to reach the smallest possible length of the corresponding algebraic expression the number k should be chosen equal to 2. When k is 2, the method generates expressions of O n 2 length.

( )

Key-Words: - complexity of an algebraic expression, Fibonacci graph, optimal representation of the algebraic expression, st-dag, st-dag expression, subexpression, subgraph complexity characteristics of an st-dag expression are denoted by T(n) and P(n) respectively, where n is the number of vertices of the graph (the size of the graph). An equivalent expression with the minimum complexity is called an optimal representation of the algebraic expression. A series-parallel (SP) graph is defined recursively as follows: (i) A single edge (u,v) is a series-parallel graph with source u and sink v. (ii) If G1 and G2 are series-parallel graphs, so is the graph obtained by either of the following operations: (a) Parallel composition: identify the source of G1 with the source of G2 and the sink of G1 with the sink of G2. (b) Series composition: identify the sink of G1 with the source of G2. As shown in [1] and [7], a SP graph expression has a representation in which each term appears only once. We proved in [7] that this representation is an optimal representation of the SP graph expression from the first complexity characteristic point of view. For example, the expression of the SP graph presented in Fig. 1 is abd+abe+acd+ace+fe+fd.

1 Introduction A graph G=(V,E) consists of a vertex set V and an edge set E, where each edge corresponds to a pair (v,w) of vertices. If the edges are ordered pairs of vertices (i.e., the pair (v,w) is different from the pair (v,w), then we call the graph directed or digraph; otherwise, we call it undirected. A path from vertex v0 to vertex vj in a graph G=(V,E) is a sequence of its vertices v0, v1, v2, …, vj–1, vj, such that (vi–1,vi) ∈ E for 1 ≤ i ≤ j. A graph G’=(V’,E’) is a subgraph of G=(V,E) if V’ ⊂ V and E’ ⊂ E. A graph G is homeomorphic to a graph G’ (homeomorph of G’) if G can be obtained by subdividing edges of G’ via adding new vertices. A two-terminal directed acyclic graph (st-dag) has only one source s and only one sink t. In an st-dag, every vertex lies on some path from the source to the sink. An algebraic expression is called an st-dag expression if it is algebraically equivalent to the sum of products corresponding to all possible paths between the source and the sink of the st-dag [1]. This expression consists of terms (edge labels), and the operators + (disjoint union) and · (concatenation, also denoted by juxtaposition when no ambiguity arises). We define the complexity of an algebraic expression in two ways. The complexity of an algebraic expression is (i) a total number of terms in the expression including all their appearances (the first complexity characteristic) or (ii) a number of plus operators in the expression (the second complexity characteristic). The first and the second

b

d

c

e

a

f Fig.1. A series-parallel graph. 1

b1

2

3

bi+1

bi a3

a2

a1 1

b2 ai

ai+2

ai+1

i

. . .

i+1

bn−2

i+2

an−1 . . .

n

n–1

Fig.2. An n-vertex Fibonacci graph. complete [14]. Some heuristic algorithms developed in order to obtain good factored forms are described in [4], [5], and other works. Therefore, generating an optimal representation (from both complexity characteristics point of view) for a non-SP st-dag expression is a highly complex problem. Our intent in this paper is to simplify the expressions of Fibonacci graphs. In [9] we presented a heuristic algorithm based on a decomposition method with that end in view. The paper [7] is a substantially improved version of [9]. Here we adduce a more generalized method (the generalized decomposition method).

This expression can be reduced to (a(b+c)+f)(d+e), where each term appears once. The notion of a Fibonacci graph (FG) was introduced in [6]. In such an st-dag, two edges leave each of its n vertices except the two final vertices (n–1 and n). Two edges leaving the i vertex (1 ≤ i ≤ n–2) enter the i+1 and the i+2 vertices. The single edge leaving the n–1 vertex enters the n vertex. No edge leaves the n vertex. This graph is illustrated in Fig. 2. As shown in [3], an st-dag is SP if and only if it does not contain a subgraph homeomorphic to the forbidden subgraph enclosed between vertices 1 and 4 of an FG from Fig. 2. Thus, Fibonacci graphs are of interest as ''through'' non-series-parallel st-dags. Notice that FGs of size 2 or 3 are series-parallel. Mutual relations between graphs and algebraic expressions are discussed in [1], [7], [8], [9], [10], [11], [12], [13], and other works. Specifically, [10], [11], and [13] consider the correspondence between SP graphs and read-once functions. A Boolean function is defined as read-once if it may be computed by some formula in which no variable occurs more than once (read-once formula). On the other hand, a SP graph expression can be reduced to the representation in which each term appears only once. Hence, such a representation of a SP graph expression can be interpreted as a read-once formula (Boolean operations are replaced by arithmetic ones). An expression of a homeomorph of the forbidden subgraph belonging to any non-SP st-dag has no representation in which each term appears once. For example, consider the subgraph enclosed between vertices 1 and 4 of an FG from Fig. 2. Possible optimal representations of its expression are a1(a2a3+b2)+b1a3 or (a1a2+b1)a3+a1b2. For this reason, an expression of a non-SP st-dag can not be represented as a read-once formula. However, for arbitrary functions, which are not read-once, generating the optimum factored form is NP-

2 The Decomposition Method for Constructing Fibonacci Graph Expressions Consider the n-vertex FG presented in Fig. 2. For brevity, we identify vertices by their ordinal numbers. Denote by E(p,q) a subexpression related to this subgraph (which is an FG also) having a source p (1 ≤ p < n) and a sink q (1 < q ≤ n, q > p). We choose any decomposition vertex i (p < i < q) on a subgraph, and, in effect, split it at this vertex (Fig. 3). As follows from FG structure any path from vertex p to vertex q passes through vertex i or avoids it via edge bi-1. Therefore, E(p,q) is generated by the following recursive procedure (decomposition procedure): 1. case q = p: E(p,q) ← 1 2. case q = p + 1: E(p,q) ← ap 3. case q > p + 1: choice(p,q,i) 4. E(p,q) ← E(p,i)E(i,q)+ E(p,i–1)bi-1E(i+1,q)

bp ap p

ai–1 p+1

bq − 2

bi–1

. . .

i

i–1

aq−1

ai i+1

. . .

Fig.3. Decomposition of a Fibonacci subgraph at vertex i. 2

q–1

q

T (1) = 0, T (2) = 1

Lines 1 and 2 contain conditions of exit from the recursion. The special case when a subgraph consists of a single vertex is considered in line 1. It is clear that such a subgraph can be connected to other subgraphs only serially. For this reason, it is accepted that its subexpression is 1, so that when it is multiplied by another subexpression, the final result is not influenced. Line 2 describes a subgraph consisting of a single edge. The corresponding subexpression consists of a single term equal to the edge label. The common case is processed in lines 3 and 4. The procedure choice(p,q,i) in line 3 chooses an arbitrary decomposition vertex i on the interval (p,q) so that p < i < q. A current subgraph is decomposed into four new subgraphs in line 4. Subgraphs described by subexpressions E(p,i) and E(i,q) include all paths from vertex p to vertex q passing through vertex i. Subgraphs described by subexpressions E(p,i–1) and E(i+1,q) include all paths from vertex p to vertex q passing via edge bi-1. E(1,n) is the expression of the initial n-vertex FG (we denote it by Ex(FG)). Hence, the decomposition procedure is initially invoked by substituting parameters 1 and n instead of p and q, respectively. The following theorem that determines an optimal location of the decomposition vertex i on the arbitrary interval (p,q) in a Fibonacci graph is proved in [7].

 n  n  T (n) = T     + T    + 1 +  2   2  n  n  T    − 1 + T     + 1, n ≥ 3.   2   2  The number of plus operators in this expression is defined similarly:

P(1) = 0, P(2) = 0 n  n  P(n) = P    + P   + 1 +   2    2   n   n P   − 1 + P    + 1, n ≥ 3.   2   2 For large n

 n T (n) ≈ 4T     + 1  2 and

 n P(n) ≈ 4 P    + 1.  2

Theorem 1. The representation with a minimum total number of terms among all possible representations of Ex(FG) derived by the decomposition method is achieved if and only if on

By the master theorem [2] the recurrence as

q− p+2 for odd 2 q − p +1 q− p +3 q–p+1 and to or for even q– 2 2

n T (n) = αT   + f (n), β 

each recursive step i is equal to

where α ≥ 1 and β > 1 are constants, and

p+1, i.e., when i is a middle vertex of the interval (p,q). This decomposition method is called optimal.

n

β

is

n n or   , can be bounded  β  β 

interpreted as either 

It can be shown that the representation with a minimum number of plus operators among all possible representations of Ex(FG) derived by the decomposition method can be achieved also by the optimal decomposition method. Thus, the total number of terms in the n-vertex FG expression derived by the optimal decomposition method is defined recursively as follows:

asymptotically as follows:

(

T ( n) = Θ n

(

if f ( n) = O n

log β α − ε

)

log β α

)

for some constant ε > 0 .

( )

Therefore, T(n) and P(n) are Θ n 2 . Specifically, if n is a power of two, then

1  19  T (n) =  n 2 − 1 3  16 

3

and The sum above consists of four parts, and each part includes three subexpressions corresponding to the three parts of a splitted subgraph. Hence, a current subgraph is decomposed into twelve new subgraphs. In the general case, a number of subgraphs after a decomposition does not exceed 2k–1k. The exact value of this number depends on the arrangement of decomposition vertices. For example, for a 4-vertex FG, k = 3, the following expression should be generated formally, according to (1):

1 7  P(n) =  n 2 − 1. 3  16  For example, for the 8-vertex FG, the possible expression derived by the optimal decomposition method is (a1(a2a3+b2)+b1a3)((a4a5+b4)(a6a7+b6)+a4b5a7)+ (a1a2+b1)b3(a5(a6a7+b6)+b5a7).

a1a2a3+b1a3+a1b2+b1b2.

It contains 25 terms and 9 plus operators. We conjecture that the optimal decomposition method provides an optimal representation (for both our complexity characteristics) of an algebraic expression of a Fibonacci graph.

However, there is no path b1b2 in the graph (decomposition vertex 3 is adjacent to decomposition vertex 2 and, therefore, edges b1 and b2 cross but do not belong to the same path). Hence, the part b1b2 of the expression is accepted to be equal to 0 and, finally, we have

3 The Generalized Decomposition (GD) Method for Constructing Fibonacci Graph Expressions

a1a2a3+b1a3+a1b2. We denote the number of additional edges (labeled b with index) which connect revealed subgraphs in an FG by Tb. In such a case,

As follows from the previous section, the decomposition method is based on splitting an FG on each recursive step into two parts via decomposition vertex i and edge bi–1. The GD method proposes splitting an FG on each recursive step into an arbitrary number of parts (we will denote this number as k) via decomposition vertices i1, i2, …, ik–1 and edges bi1 −1 , bi2 −1 ,..., bik −1 −1

k −1

Tb ≤ ∑ C ky−1 ⋅ y = 2 k − 2 (k − 1). y=0

The number of additional plus operators between parts of the derived expression is denoted by P+ and is estimated as

respectively. For instance, an example for k = 3 is illustrated in Fig. 4. In all cases when k > 2, the decomposition procedure used in the previous section is transformed to the more complex form. Specifically, for k = 3, the general line of the new decomposition procedure corresponding to line 4 of the previous decomposition procedure is presented as E(p,q) ← E(p,i1)E(i1,i2)E(i2,q)+ E(p,i1–1) bi1 −1 E(i1+1,i2)E(i2,q)+

P+ ≤ 2 k −1 − 1. Suppose that an FG is splitted into approximately equal parts on each recursive step (distances between decomposition vertices are equal or close). It will be the uniform GD method. In such a case, for an n-vertex FG, the total number of terms T(n) in the expression Ex(FG) derived by the uniform GD method can be estimated for large n as follows:

(1)

E(p,i1) bi1 −1 E(i1,i2–1) bi2 −1 E(i2+1,q)+ E(p,i1–1) bi1 −1 E(i1+1,i2–1) bi2 −1 E(i2+1,q).

bi1 −1

p

. . .

bi2 −1 i1

i2

. . .

Fig.4. Decomposition of a Fibonacci subgraph at vertices i1 and i2. 4

q

a1a2b3a5b6+a1a2b3b5a7+a1b2a4a5a6a7+ a1b2a4a5b6+a1b2a4b5a7+a1b2b4a6a7+ a1b2b4b6+b1a3a4a5a6a7+b1a3a4a5b6+ b1a3a4b5a7+b1a3b4a6a7+b1a3b4b6+ b1b3a5a6a7+b1b3a5b6+b1b3b5a7.

n T (n) ≤ 2 k −1 kT     + 2 k − 2 (k − 1).  k  By the master theorem

(

T (n) = O n log k (2

k −1

k

) (

) = O n1+ log

k

2 k −1

).

It contains 21 products (that correspond to 21 sequential paths of the graph), 109 terms and 20 plus operators. These results do not contradict to our conjecture that the optimal decomposition method provides an optimal representation. At least, it is the best one among uniform GD methods (asymptotically).

(2)

Analogously, for an n-vertex FG, the number of plus operators P(n) in the expression Ex(FG) derived by the uniform GD method can be estimated for a large n as follows:

 n P (n) ≤ 2 k −1 kT     + 2 k −1 − 1.  k 

4 Conclusion and Future Work The paper investigates relationship between algebraic expressions and Fibonacci graphs. The optimal decomposition method applied to an nvertex Fibonacci graph generates an expression with O n 2 complexity. This method is the best one among uniform generalized decomposition methods. In the extreme case the uniform generalized decomposition method is reduced to the sequential paths method that generates an expression of exponential complexity. We do not have a formal proof that splitting a Fibonacci graph into approximately equal parts gives the optimal result for an arbitrary number of parts (as in Theorem 1 where the number of parts equals two). Besides, the GD method considers splitting a Fibonacci graph into the same number of parts on each recursive step. One further generalization of the method assigns to any subgraph its own number of decomposition vertices. While, there exist representations derived by algorithms which can not be related even to generalized decomposition methods, we conjecture that the optimal decomposition method yields the shortest expression possible.

Hence, by the master theorem

(

P (n) = O n 1+ log k 2

k −1

).

(3)

( )

As follows from (2) and (3) T(n) and P(n) reach the minimum complexity among 2 ≤ k ≤ n–1 when k = 2. Substituting 2 for k in (2) and (3) gives O n 2 (we have the optimal decomposition method in such a case). Further, the complexity increases with increase of k. For example, we have O n1+log 3 4 for

( )

(

( )

)

k = 3, O n 2.5 for k = 4, etc. In the extreme case, when k = n–1, all inner vertices (from 2 to n–1) of an n-vertex FG are decomposition vertices. The single recursive step is executed in such a situation, and all revealed subgraphs are individual edges (labeled a with index) connected by additional edges (labeled b with index). Hence, we have the sum of products corresponding to all possible paths between the source and the sink of the FG. This sum is a base for the definition of the st-dag expression. The method generating such an FG expression representation is called the sequential paths method [9]. That is, the uniform GD method is reduced to the sequential paths method in such a case. Substituting n–1 for k in (2) and (3) gives

(

O n1+log n −1 2

n− 2

) > O(n

1+ log n 2 n − 2

References: [1] W. W. Bein, J. Kamburowski, and M. F. M. Stallmann, Optimal Reduction of Two-Terminal Directed Acyclic Graphs, SIAM Journal of Computing, Vol. 21, No. 6, 1992, pp. 1112-1129. [2] T. H. Cormen, C. E. Leiseron, and R. L. Rivest, Introduction to Algorithms, The MIT Press, Cambridge, Massachusetts, 1994. [3] R. J. Duffin, Topology of Series-Parallel Networks, Journal of Mathematical Analysis and Applications 10, 1965, pp. 303-318.

) = O(2 n) . n−2

The example, when the uniform GD method turns out to be the sequential paths method is adduced above, for the 4-vertex FG. For the 8-vertex FG, the corresponding algebraic expression is a1a2a3a4a5a6a7+a1a2a3a4a5b6+a1a2a3a4b5a7+ a1a2a3b4a6a7+a1a2a3b4b6+a1a2b3a5a6a7+

5

[4] M. C. Golumbic and A. Mintz, Factoring Logic Functions Using Graph Partitioning, Proc. IEEE/ACM Int. Conf. Computer Aided Design, November 1999, San Jose, California, USA, pp. 195-199. [5] M. C. Golumbic, A. Mintz, and U. Rotics, Factoring and Recognition of Read-Once Functions using Cographs and Normality, Proc. 38th Design Automation Conference, Las Vegas, Nevada, USA, June 2001, pp. 109-114. [6] M. C. Golumbic and Y. Perl, Generalized Fibonacci Maximum Path Graphs, Discrete Mathematics 28, 1979, pp. 237-245. [7] M. Korenblit and V. E. Levit, On Algebraic Expressions of Series-Parallel and Fibonacci Graphs, in: Discrete Mathematics and Theoretical Computer Science, Proc. 4th Int. Conf., DMTCS 2003, LNCS 2731, 2003, pp. 215224. [8] V. E. Levit and M. Korenblit, Symbolic PERT and its Generalization, in: Intelligent Scheduling of Robots and Flexible Manufacturing Systems, Proc. Int. Workshop held at the Center for Technological Education Holon, Holon, Israel, July 1995, pp. 65-80. [9] V. E. Levit and M. Korenblit, A Symbolic Approach to Scheduling of Robotics Lines, in: Intelligent Scheduling of Robots and Flexible Manufacturing Systems, The Center for Technological Education Holon, Holon, Israel, 1996, pp. 113-125. [10] D. Mundici, Functions Computed by Monotone Boolean Formulas with no Repeated Variables, Theoretical Computer Science 66, 1989, pp. 113114. [11] D. Mundici, Solution of Rota’s Problem on the Order of Series-Parallel Networks, Advances in Applied Mathematics 12, 1991, pp. 455-463. [12] V. Naumann, Measuring the Distance to Series-Parallelity by Path Expressions, in: Graph-Theoretic Concepts in Computer Science, Proc. 20th Int. Workshop, WG ‘94, LNCS 903, 1994, pp. 269-281. [13] P. Savicky and A. R. Woods, The Number of Boolean Functions Computed by Formulas of a Given Size, Random Structures and Algorithms 13, 1998, pp. 349-382. [14] A. R. R. Wang, Algorithms for Multilevel Logic Optimization, Ph.D. Thesis, University of California, Berkeley, 1989.

6