[ieee 2009 third asia international conference on modelling & simulation - bundang, bali,...

4
Evolutionary-Reduced Ordered Binary Decision Diagram Hossein Moeinzadeh ¥, φ , Mehdi Mohammadi Ψ, £ , Hossein Pazhoumand-dar Φ , Arman Mehrbakhsh ψ , Navid Kheibar ξ , Nasser Mozayani ¥, θ Ψ Department of Computer engineering, Islamic Azad University-Hashtgerd branch, Karaj, Iran ¥ Department of Computer engineering, Iran University of Science and Technology, Tehran, Iran Φ Department of Computer engineering, Islamic Azad University-Mashhad branch, Mashhad, Iran ψ Department of Computer engineering, Islamic Azad University-Lahijan branch, Lahijan, Iran ξ Department of Computer engineering, University of Isfahan, Isfahan, Iran { φ moeinzadeh, £ me_mohammadi}@comp.iust.ac.ir, θ [email protected] Abstract—Reduced ordered binary decision diagram (ROBDD) is a memory-efficient data structure which is used in many applications such as synthesis, digital system, verification, testing and VLSI-CAD . The size of an ROBDD for a function can be increased exponentially by the number of independent variables of the function that is called “memory explosion problem”. The choice of the variable ordering largely influences the size of the OBDD especially for large input variables. Finding the optimal variable ordering is an NP-complete problem, hence, in this paper, two evolutionary methods (GA and PSO) are used to find optimal order of input variable in binary decision diagram. Some benchmarks form LGSynth91 are used to evaluate our suggestion methods. Obtained results show that evolutionary methods have the ability to find optimal order of input variable and reduce the size of ROBDD considerably. Keywords-Genetic Algorithm; Particle Swarm Optimization, Reduce Order Binary Decsion Diagram I. INTRODUCTION Reduced Ordered Binary Decision Diagram (ROBDD) [3] is a memory-efficient data structure for Boolean function manipulations, which is widely used in logic synthesis, verification and VLSI-CAD. A central issue in providing computer-aided solutions to these problems is to find a compact representation for Boolean functions on which the basic Boolean operations and equivalence check can be efficiently performed [2]. Over the years, ROBDDs have become one of the most popular representations for Boolean functions. Unfortunately, ROBDDs suffer from the memory explosion problem. In many cases of practical interest, the ROBDD representation of a Boolean exponentially by number of independent variables of the function. This large space requirement places a limit on the complexity of problems which can be solved using ROBDDs and has been the focus of intense research over the last decade. The main advantages of the ROBDD approach include, firstly, the possibility of performing global optimization independent of the initial form of the Boolean network. Secondly, it could handle very high complex circuits that cannot be handled by classical Boolean or algebraic factorization algorithms and finally, the possibility of using the procrastination algorithm in order to favor the delayed inputs [2]. The remaining of this paper is organized as follows: In the second section, we define formulation of the problem then in the third section related works are discussed. In the forth section our new approach is investigated. The fifth section represents experimental results and finally, the last section contains the conclusion. II. FORMULATION AND PROBLEM A Binary Decision Diagram (BDD) representation of a Boolean function f: B n B, where B = {0, 1}, over a set X n = {x 1 ,…,x n } of Boolean variables is a directed acyclic graph with a vertex (node) set V. Vertices are divided in two types: terminal and non-terminal (internal). A terminal vertex is labeled by zero or one. Each non-terminal vertex v is labeled by a variable x € X n and has two children, low(v), high(v) € V, corresponding to whether the variable evaluates to zero or one. For a given assignment to the variables, the function value is evaluated by tracing a path from the root to a terminal. For a given input m = (m 1 ,.., m n ), the evaluation starts at the root. At a non-terminal node v with label x i , if m i = 0 then the outgoing edge corresponding to low(v) is chosen. Otherwise, the edge corresponding to high(v) is chosen. Fig. 1 represents an example of BDDs. Figure 1. BDD example: F=x1x3+x2x3 Though BDDs have been researched for about four decades [1, 4], they found widespread use only after Bryant [3] showed that such graphs, under two restrictions, are X1 X2 X3 X2 0 1 X3 1 1 1 1 1 0 0 0 0 0 1 2009 Third Asia International Conference on Modelling & Simulation 978-0-7695-3648-4/09 $25.00 © 2009 IEEE DOI 10.1109/AMS.2009.130 142

Upload: nasser

Post on 22-Mar-2017

219 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: [IEEE 2009 Third Asia International Conference on Modelling & Simulation - Bundang, Bali, Indonesia (2009.05.25-2009.05.29)] 2009 Third Asia International Conference on Modelling &

Evolutionary-Reduced Ordered Binary Decision Diagram

Hossein Moeinzadeh¥, φ, Mehdi MohammadiΨ, £, Hossein Pazhoumand-darΦ, Arman Mehrbakhshψ, Navid Kheibarξ, Nasser Mozayani¥, θ

Ψ Department of Computer engineering, Islamic Azad University-Hashtgerd branch, Karaj, Iran ¥ Department of Computer engineering, Iran University of Science and Technology, Tehran, Iran Φ Department of Computer engineering, Islamic Azad University-Mashhad branch, Mashhad, Iran ψ Department of Computer engineering, Islamic Azad University-Lahijan branch, Lahijan, Iran

ξ Department of Computer engineering, University of Isfahan, Isfahan, Iran {φ moeinzadeh, £ me_mohammadi}@comp.iust.ac.ir, θ [email protected]

Abstract—Reduced ordered binary decision diagram (ROBDD) is a memory-efficient data structure which is used in many applications such as synthesis, digital system, verification, testing and VLSI-CAD . The size of an ROBDD for a function can be increased exponentially by the number of independent variables of the function that is called “memory explosion problem”. The choice of the variable ordering largely influences the size of the OBDD especially for large input variables. Finding the optimal variable ordering is an NP-complete problem, hence, in this paper, two evolutionary methods (GA and PSO) are used to find optimal order of input variable in binary decision diagram. Some benchmarks form LGSynth91 are used to evaluate our suggestion methods. Obtained results show that evolutionary methods have the ability to find optimal order of input variable and reduce the size of ROBDD considerably.

Keywords-Genetic Algorithm; Particle Swarm Optimization, Reduce Order Binary Decsion Diagram

I. INTRODUCTION Reduced Ordered Binary Decision Diagram (ROBDD)

[3] is a memory-efficient data structure for Boolean function manipulations, which is widely used in logic synthesis, verification and VLSI-CAD. A central issue in providing computer-aided solutions to these problems is to find a compact representation for Boolean functions on which the basic Boolean operations and equivalence check can be efficiently performed [2]. Over the years, ROBDDs have become one of the most popular representations for Boolean functions. Unfortunately, ROBDDs suffer from the memory explosion problem. In many cases of practical interest, the ROBDD representation of a Boolean exponentially by number of independent variables of the function. This large space requirement places a limit on the complexity of problems which can be solved using ROBDDs and has been the focus of intense research over the last decade. The main advantages of the ROBDD approach include, firstly, the possibility of performing global optimization independent of the initial form of the Boolean network. Secondly, it could handle very high complex circuits that cannot be handled by

classical Boolean or algebraic factorization algorithms and finally, the possibility of using the procrastination algorithm in order to favor the delayed inputs [2].

The remaining of this paper is organized as follows: In the second section, we define formulation of the problem then in the third section related works are discussed. In the forth section our new approach is investigated. The fifth section represents experimental results and finally, the last section contains the conclusion.

II. FORMULATION AND PROBLEM A Binary Decision Diagram (BDD) representation of a

Boolean function f: Bn → B, where B = {0, 1}, over a set Xn = {x1,…,xn} of Boolean variables is a directed acyclic graph with a vertex (node) set V. Vertices are divided in two types: terminal and non-terminal (internal). A terminal vertex is labeled by zero or one. Each non-terminal vertex v is labeled by a variable x € Xn and has two children, low(v), high(v) € V, corresponding to whether the variable evaluates to zero or one. For a given assignment to the variables, the function value is evaluated by tracing a path from the root to a terminal. For a given input m = (m1,.., mn), the evaluation starts at the root. At a non-terminal node v with label xi, if mi = 0 then the outgoing edge corresponding to low(v) is chosen. Otherwise, the edge corresponding to high(v) is chosen. Fig. 1 represents an example of BDDs.

Figure 1. BDD example: F=x1x3+x2x3

Though BDDs have been researched for about four decades [1, 4], they found widespread use only after Bryant [3] showed that such graphs, under two restrictions, are

X1

X2

X3

X2

0

1

X3

1 1

1

1

1

0

0

0 0

0

1

2009 Third Asia International Conference on Modelling & Simulation

978-0-7695-3648-4/09 $25.00 © 2009 IEEE

DOI 10.1109/AMS.2009.130

142

Page 2: [IEEE 2009 Third Asia International Conference on Modelling & Simulation - Bundang, Bali, Indonesia (2009.05.25-2009.05.29)] 2009 Third Asia International Conference on Modelling &

canonical and can be easily manipulated. The first restriction is that a total ordering of the variables is enforced on the graph. That is, if we consider variables to be ordered as x1 < x2 < …< xn, then every path from the root to a terminal encounters the variables in that order. The second restriction is that the graph is reduced. A graph can be reduced by the repeated application of the following two rules until they are no longer applicable. These rules are:

• Merging Rule: Two isomorphic sub-graphs should be merged.

• Deletion Rule: A vertex whose two branches point to the same vertex should be deleted.

Figure 2. Variable ordering and ROBDD size: F=x1y1+x2y2+x3y3

The resulting BDD is called a Reduced Ordered BDD

(ROBDD). The size of an ROBDD strongly depends on the ordering of its variables. For example, for the function F = x1y1+x2y2+…+xnyn, the ordering x1 < x2 < … < xn < y1<… < yn will result in an ROBDD which is exponential in the number of variables where as the ordering x1 < y1 < x2 < y2 <… < xn < yn will result in a linearly sized ROBDD as shown in Fig. 2.

Hence, selecting an ordering for the function variables, minimizing the number of nodes in the graph is critical to the effective use of ROBDDs. The problem of determining the best variable ordering is NP-complete [3], and therefore exact algorithms are feasible only for functions of a small number of variables.

III. RELATED WORK Various ordering heuristics can be classified as static or

dynamic approaches [12], which will be discussed as follows

A. Static Variable Ordering In this approach, the variables are chosen in the manner

in which they appear to be most naturally together in the structural description. Lacking adequate functional analysis, topology based static ordering schemes often fail to appropriately order variables of a given function approaches (i.e. depth-first or breadth-first search) [13, 14].

B. Dynamic Variable Ordering To compute variable ordering [15, 16, 17, 18], dynamic

approach starts with an initial order, which is then analyzed and permuted at internal points in the circuit/function to minimize the cost function (often the size of the resulting BDD). However, such a technique can be also extremely expensive in runtime.

A sifting-based dynamic ordering approach appears to be one of the most popular approaches to the ordering problem [18]. In this procedure, a periodic reordering of variables is attempted to reduce memory requirements. In an OBDD package, whenever the size of graph exceeds the original size by a certain proportion, the reordering method can be triggered to reduce the graph size. Given a graph G, a variable v is moved (sifted) to each position in the ordering list and the resulting graph size is examined. The variable is finally assigned the position which results in the smallest graph size. The process is repeated for each variable in the graph [12].

IV. PROPOSED APPROACH As mentioned before, finding the optimal variable

ordering is an NP-complete problem [2]. The choice of the variable ordering largely influences the size of the OBDD. In this paper we present an approach to determine a good variable ordering for a given Boolean function using evolutionary methods (i.e. Genetic Algorithm (GA) and Particle Swarm Optimization (PSO)).

A. Optimal variable ordering using GA Genetic Algorithm is one of meta-heuristic optimization

techniques, which includes simulated annealing, tabu search, and evolutionary strategies. GA has been demonstrated to converge to the optimal solution for many diverse and difficult problems as a powerful and stochastic tool based on principles of natural evolution [5]. The details of our implementation of GA are described as follows:

Algorithm1: Genetic Algorithm Input: Truth Table Output: Optimal variable ordering Step0: initialize parameters (e.g. population size, crossover rate, mutation rate and the maximum number of population generation.) Step1: create initial population randomly (P(0)). Step2: evaluate current population (compute fitness of all chromosomes). Step3: while (termination condition not satisfied) do [step 4-8] Step4: select P(t) from P(t-1) [perform selection] Step5: recombine P(t) [perform mutation and crossover] Step6: evaluate current population (compute fitness of all chromosomes). Step7: t = t + 1 Step8: go to Step 3

Figure 3. Pseudo code for GA

X1

Y1

X3

Y2

Y3

X2

0 1

0

0

0

0

0 0

1

1

1 1

1

1

X1

Y1

X3

Y2

Y3

X2

0 1

X2

X2 X2 X2

Y1 Y1 Y1

Y2

0 1

0

0 0

0

0

0

0

0

0

0 0

0

0

1

1

1

1

1

1

1

1

1

1

1

1

1

143

Page 3: [IEEE 2009 Third Asia International Conference on Modelling & Simulation - Bundang, Bali, Indonesia (2009.05.25-2009.05.29)] 2009 Third Asia International Conference on Modelling &

1) Construction of the hypothesis space The first step in GAs is to define the encoding allowing

to describe any potential solution as a numerical vector. A chromosome represented by a vector with size m (as the number of input variables), specifies the order of variables in the OBDD.

X1

X2

X3

Figure 4. Representation of binary decision diagram as a chromosome

Fig.4 depicts representation of a chromosome as a complete binary decision diagram with three input variables.

2) Selection operator

The selection process selects individuals from population directly based on fitness values [6]. In this paper, the binary tournament selection [5] is used in which two individuals are chosen from population at random and the individual with better fitness is selected for next population.

3) Recombination The role of the crossover operation is to create new

individuals from old ones. Crossover often is a probabilistic process that exchanges information between some (usually two) parent individuals in order to generating some new child individuals. Here we use Cut-and-crossfill with a fixed crossover probability of μ [5]. In this crossover, a random integer (crossover point) is generated in the range of [1, l-1] (l is the length of individual). The portions of the individuals lying to the right of the crossover point in two parents are exchange to produce two offspring.

4) Mutation Operator Mutation is applied to one individual and produces a

modified mutant child. We have used Swap mutation method which simply changes the position of two samples at random [6].

5) Fitness Function The role of the Fitness function is to measure the quality

of solutions. Each Chromosome is stores order of input variables. We use the number of nodes of the OBDD corresponding to the chosen variable ordering.

B. Optimal variable ordering using PSO Given the NP-hardness of finding the optimal order of

variables in diagram, we design a heuristic method based on particle swarm optimization [7,8] in which each particle searches for the optimal solution by sharing historical and social information between the particle individuals. PSO has some advantages over other similar optimization techniques such as GA. The advantages include, firstly, PSO is easier to implement and there are fewer parameters to adjust.

Secondly, in PSO, every particle remembers its own previous best value as well as the neighborhood best, therefore, it has a more memory efficiency than the GA and finally, it is more efficient in maintaining the diversity of the swarm [8] (more similar to the ideal social interaction in a community), since all the particles use the information related to the most successful particle in order to improve themselves, whereas in GA, the worse solutions are discarded and only the good ones are saved; therefore, in GA the population evolves around a subset of the best individuals [10]. We stress the basic elements of this algorithm as follows. • Construction of the hypothesis space: To express the

order of input variables in diagram, we use an integer vector of length m which denotes the number of variables of the considered OBDD as in Fig. 4 used in GA.

• Designation of the fitness function: In the light of the goal of finding the optimal order of input variables, the goodness and badness of each individual depends on the number of nodes of the OBDD corresponding to the chosen variable ordering. Hence, we use a fitness function as in GA. Detailed procedures of the designed PSO algorithm are described as follows:

Algorithm: Particle Swarm Optimization Input: Truth Table Output: Optimal variable ordering Step0: Give proper parameter settings, e.g. population size N, study factors c1, c2 particle size M (number of input variable) and maximum generation GN. Step1: Initialize all particles, k = 0. Step2: Evaluate all particles. Step3: Judge whether the termination criterion is satisfied. If k > GN, stop (Go to Step 8), otherwise refresh variables according to the following method: [step 4 - 6] Step4: Refresh Pid. Comparing the current fitness of each particle with its own historical best position Pid, if its own historical best position Pid is smaller, then it is replaced with the current position. Step5: Refresh Pgd. Comparing the current best fitness of all particles with the historical best position Pgd of the whole swarm, if the historical best position Pgd is smaller, then it is replaced with the current best position of all particles. Step6: Refresh f(k) and v(k) using the below formula ( {1,2,..., }i M∀ ∈ ):

( )( )

1

2

( 1) ( ) . (). ( ) ( )

. (). ( ) ( )i i i i

g i

V k V k c rand P k f k

c rand P k f k

+ = + − +

− (1)

( )2( 1) 1

1 exp( ( 1))ii

f kV k

+ = −+ − +

(2)

Step7: k = k + 1, go to Step 2. Step8: End.

Figure 5. Pseudo code for PSO

X1

X2

X3

X2

1 0

X3

1 1

1

1

1

0

0

0

0

0

1

X3 X3

0

10 110

144

Page 4: [IEEE 2009 Third Asia International Conference on Modelling & Simulation - Bundang, Bali, Indonesia (2009.05.25-2009.05.29)] 2009 Third Asia International Conference on Modelling &

The first term of Eq. 1 is the velocity of the particle in previous step, the second is the cognition, representing the exploiting of its own experience, where c1 is individual factor, and the third is the social which represents the shared information and mutual cooperation among particles, where c2 is the social factor [11].

V. EXPERIMENTAL RESULTS In this section, the experimental results are presented.

The implementation of proposed methods is developed using Microsoft VC++6. Both population size and maximum generation values are set as 200. We applied our evolutionary methods to several benchmark circuits from LGSynth91. To evaluate performance of proposed evolutionary ORBDD, we have used Sift method. As shown in Table 1, evolutionary methods could obtain better results than sift method in most cases especially when the input variable are increased. Furthermore, PSO demonstrate the ability to get better results in comparison to GA.

TABLE I. COMPARISON OF EVOLUTIONARY-ROBDD TO OPTIMAL METHOD

Name In Out Sift GA PSO trial 14 8 855 564 558

cm85a 11 3 35 27 27 cm151a 12 2 16 16 16 cm162a 14 5 36 29 27 cm163a 16 5 27 23 25

cmb 16 4 27 24 24 cu 14 11 34 30 28

gray 15 11 301 287 285 m181 15 9 58 52 50 risc 8 31 66 63 61

s1494 14 25 387 365 363 sqn 7 3 48 48 48

z5xp1 7 10 41 39 37 add6 12 7 68 25 26

addm4 9 8 163 160 157 alu4 14 8 601 321 320 x2dn 82 56 177 144 140 in7 26 10 82 74 74 ibm 48 17 417 204 201 k2 45 45 1386 1251 1251

chkn 29 7 328 251 244 cps 24 109 1026 961 972 in2 19 10 256 230 231 vg2 25 8 194 79 74

s1196 32 32 641 596 587

VI. CONCLUSION Finding the optimal variable ordering is an NP-complete

problem. We implemented two methods for finding optimal order of input variable in binary decision diagram which were based on evolutionary methods (i.e. GA and PSO). To evaluate suggested methods, we use some benchmarks form LGSynth91. The results show that these methods were

capable of finding optimal order of input variables. Furthermore, PSO demonstrate the ability to get better results in comparison to GA.

REFERENCES [1] S.B. Akers, “Binary Decision Diagrams”. IEEE Transactions on

Computers, pp. 509-516, June 1978. [2] A. Narayan, “Recent Advances in BDD Based Representations for

Boolean Functions: A Survey”, In Proceedings of the 12th international conference on VLSI design, pp. 408-413, 1999.

[3] R.E. Bryant, “Graph-based Algorithms for Boolean Function Manipulation ”. IEEE Transactions on Computers, pp. 677-691, August 1986.

[4] C.Y. Lee. “Representation of switching circuits by binary decision programs.”, Bell Syst. Tech. J., pp. 985-999, 1959.

[5] M. Gen and Y. Yun, “soft computing approach for reliability optimization: state of the art survey”, In Proceedings of the Reliability engineering and system safety, pp 1008-1026, 2006.

[6] A.E. Eiben and J.E. Smith,“Introduction to Evolutionary Computing”, Springer, 2nd printing, 2007.

[7] E.R. and J. Kennedy “A new optimizer using particle swarm theory.”, In Proceedings of the 6th International Symposium on Micro Machine and Human Science, IEEE Service Center, Nagoya, vol. 1, 1995, pp 39–43.

[8] J. Kennedy and R. Eberhart, “A discrete binary version of the particle swarm algorithm”, In Proceedings of the IEEE International Conference on Systems, Man, and Cybernetics, IEEE Press, Piscataway, NJ, 1997, pp 4104–4108.

[9] A.P. Engelbrecht, “Particle swarm optimization: Where does it belong?”, In Proceedings of the IEEE Swarm Intell. Symp., May 2006, pp 48–54.

[10] Y.D. Valle, etc., “Particle Swarm Optimization: Basic Concepts, Variants And Applications In Power Systems”,. IEEE Transactions On Evolutionary Computation, 2006, pp 1-25

[11] M-P. Song and G-Ch. Gu, “Research On Particle Swarm Optimization: A Review”. In Proceedings of the Third International Conference on Machine Learning and Cybernetics, 2004, pp. 2236-2241.

[12] J. Jawahar, A. William and F.Masahiro, ”Sampling scheme for computing OBDD variable ordering”, In Proceedings of the IEEE/ACM international conference on computer aided design, 1998, pp. 631-638.

[13] M. Fujita et al. “Evaluation and improvements of Boolean comparison method based on Binary Decision Diagrams”. ICCAD, 1988

[14] S. Malik et al.,“Logic verification using Binary Decision Diagrams in a logic synthesis environment”. ICCAD, 1988

[15] N. Ishiura et al. “Minimization of Binary Decision Diagrams based on exchange of variables”. DAC, 1991.

[16] R. Drechsler et al. “A genetic algorithm for variable ordering of OBDDs”. IEEE Proc. Comp. Digital Techniques, 1996.

[17] M. Fujita et al. “On variable ordering of Binary Decision Diagrams for the application of multi-level logic synthesis.” EDAC, 1991

[18] R. Rudell. “Dynamic variable ordering for Ordered Binary Decision Diagrams.” ICCAD, 1993

145