Evolving Binary Decision Diagrams with emergent ... - CiteSeerX

Report 2 Downloads 103 Views
Evolving Binary Decision Diagrams with emergent variable orderings Richard M. Downing University of Birmingham, Edgbaston, UK, [email protected],

Abstract. Binary Decision Diagrams (BDDs) have become the data structure of choice for representing discrete functions in some design and verification applications: They are compact and efficient to manipulate with strong theoretical underpinnings. However, and despite many appealing characteristics, BDDs are not a representation commonly considered for evolutionary computation (EC). The inherent difficulties associated with evolving graphs combined with the variable ordering problem poses a significant challenge which is yet to be overcome. This work addresses this challenge and presents a new approach to evolving BDDs that exhibits good variable orderings as an emergent property.

1

Introduction

The variable ordering problem is prominent in all BDD1 applications, not just EC. If a good variable ordering can be found the BDD representation of a function will often be simple and efficient to manipulate [3]. However, the variable ordering problem is NP-complete in both optimal and approximate solutions [2, 13]. Furthermore, Krause [9] has argued theoretically that synthesising even an approximating function in the BDD representation is hard, and further suggested that the variable ordering must be optimised during the synthesis procedure. The EA presented here optimises the variable ordering alongside function. It is elegant in its construction and can exhibit near optimal orderings as an emergent property. Most of the previous approaches to evolving BDDs have employed only a static variable ordering and have therefore been limited to functions for which a good variable ordering is known in advance [15, 12, 6, 14, 4]. For most practical applications, however, good variable orderings cannot be known in advance so the variable ordering must be optimised along with functional fitness. Only Droste [7] has addressed this previously with a distributed hybrid approach, combining his earlier BDD-based GP with existing heuristics for variable reordering. The important aspects of BDDs are reviewed in section 2, and the algorithm for evolving them introduced in section 3. The relationship between evolvability and variable ordering is then investigated, and it is shown in section 4 that better variable orderings are associated with greater evolvability. That result is 1

The term BDD is used here as the generic sense; there are many variants.

II

then used in section 5 to account for the emergence of good variable orderings demonstrated therein.

2

Binary Decision Diagrams

BDDs [1, 10] are similar in principle to the more familiar decision tree, and can be considered a generalisation of binary decision trees. A BDD is a rooted directed acyclic graph representing a function of the form f (V ) : Bn −→ B. Each nonterminal is labelled with a Boolean variable v ∈ V and has a then child and an else child, reflecting the fact that each non-terminal represents an if-then-else operation on v. Terminals are labelled from B. Given an assignment of values for V , the output is determined by traversing the BDD from the root to a terminal following the child indicated by each vertice’s variable label value. An ordered BDD (OBDD) [3] imposes a total ordering on the appearance of non-terminal labels along any path with π, the variable ordering. Thus, π = [v1 , v2 , . . . , vn ], an ordered list of variables, and i < j must hold for each vi followed by vj along any path. It is not necessary that all v ∈ π appear in a path. In this paper the notation [v1 , v2 , . . . , vn ]-OBDD is used to specify the ordering associated associate with an OBDD, or simply π-OBDD to emphasise the significance of the ordering without specifying it. Redundancy in an OBDD can be removed in two ways: 1. Remove redundant tests A nonterminal α that has both outgoing edges pointing to the same vertex β is redundant. Redirect all α’s incoming edges to β. 2. Remove duplicate vertices If nonterminals α and β have identical substructure and variable label, then β can be removed with its incoming edges redirected to α. A reduced OBDD (ROBDD) is an OBDD that cannot have its complexity reduced further by the reductions described above. Bryant [3] has shown ROBDDs to be canonical forms; meaning that each function has a unique ROBDD representation for any given π, allowing easy equivalence and satisfiability checking. It is OBDDs and ROBDDs that are of most practical use. In section 5, the space of all OBDDs for all π are taken as the genotype space. The redundancy of having many OBDD equivalent representations has been found to enhance the search [4, 5] through the neutrality concept [8]. In section 4, subspaces of genotype space, restricted by categories of π, will also be used. The variable ordering, π, can have a dramatic impact on the complexity of resulting π-ROBDD: In this paper, the complexity of an π-(R)OBDD is the number of nonterminals it contains. For example, figure 1 shows the effect of reversing π for the 6-bit multiplexer problem. For the n-bit multiplexer, the complexity of ROBDD is known to grow linearly for the best π and exponentially for the worst. Furthermore, as n increases, the fraction of π leading to ROBDDs exponential in complexity is said to converge to 1 [7]. While some functions are insensitive to the π in this respect, many are expected to have similar properties

III

0

1

0

1

Fig. 1. The influence of variable ordering on ROBDD complexity. The two ROBDDs represent the 6-bit multiplexer function. The ROBDD on the left has ordering [0, 1, 2, 3, 4, 5] (control bits = 0,1), the one on right has the reverse ordering, [5, 4, 3, 2, 1, 0].

to the multiplexer. Thus, for applications employing ROBDDs, the problem of finding a good π is of crucial significance. All heuristic approaches to dynamic variable ordering are built on the procedure for swapping adjacent variables without affecting function; see [11] for an efficient implementation method. Variable swapping has complexity proportional to the number of nodes associated with the two adjacent variables, so can generally be done in reasonable time.

3

Evolving BDDS using implicit neutrality

The EA for evolving BDDs is now introduced. It is derived and extended from that introduced in the paper entitled Evolving Binary Decision Diagrams using Implicit Neutrality [4]. The highly significant extension introduced here is that of dynamic variable ordering. From hereon this EA will be referred to by the acronym EBDDIN after the title of the paper that introduced it and in recognition of the underlying principle evident in the approach. This principle is that of exploiting the neutrality implicit in the OBDD representation, and is thus differentiated from methods typically employed for introducing neutrality through the absence of any explicit mapping from one representation to another. Exploiting this implicit neutrality offers considerable inherent benefits within the context of OBDDs [4, 5]. The following atomic mutations are defined, five explicitly neutral and one functionally modifying. The neutral atomic mutations are derived from established OBDD theory; the functionally modifying atomic mutation is a natural and intuitive one for any graph-based representation. Definition 1 Let N1 be the neutral mutation of removing a redundant test. Definition 2 Let N10 be the neutral mutation of inserting a redundant test, the inverse of N1.

IV initialise

select parent(s)

repeat bound-1 times or while not mutated

repeat for each offspring

choose mutation

attempt mutation

no

yes

offspring adapted?

no copy fitness value from parent

evaluate offspring inject offspring into population

terminate? yes

Fig. 2. Algorithm flowchart. The bound (mutation bound) parameter is an integer specifying the number of attempts at choosing and applying an atomic mutation. If the selected vertex (or vertices) is not amenable to the chosen mutation operation, the mutation attempt is deemed a failure. If all ‘bound’ mutation attempts are either failures or are neutral, the fitness value can be copied over from the parent.

Definition 3 Let N2 be the neutral mutation of removing a redundant nonterminal (merging two equivalent non-terminals). Definition 4 Let N20 be the neutral mutation of inserting a redundant nonterminal, the inverse of N2 (splitting). Definition 5 Let N3 be the neutral mutation of swapping adjacent variables while maintaining overall function. Definition 6 Let A1 be the ‘potentially’ adaptive (or functionally modifying) mutation of changing one of the children of a non-terminal, to another vertex, potentially orphaning a sub-graph. The general structure of the breeding algorithm is depicted in figure 2. The choice of selection scheme is somewhat arbitrary: Tournament selection and both

V

(µ + λ) and (µ, λ) ES schemes have all been found to work well in practice. The atomic mutations are applied to randomly selected vertices or variables in a way that respects the requirement of total variable ordering demanded for all paths through an OBDD. The mutations are atomic in the sense that they are each considered minimal changes. More severe changes are achieved by stringing together atomic mutations, the maximum number of which is specified by the bound parameter.2 In practice, about one quarter of all mutation attempts fail, so the actual number of atomic changes between parent and offspring genotype lies somewhere between 1 and the bound inclusive when clones are prohibited. There are many BDD packages available but they are typically restricted to working with OBDDs in their reduced form only, and not amenable to the methods described herein. For this reason the author’s own experimental OBDD implementation package was employed for all experiments described in this paper. However, only implementation independent performance measures are used in the evaluation of these experiments.

4

Evolvability and variable ordering

The aim of this section is to establish the relationship between evolvability and the ROBDD complexities induced by π. The complexity of ROBDD induced by a given π for a given problem is referred to in this paper as the Implied Solution Complexity (ISC) of π, or of an π-(R)OBDD. For example, the ISC of π = [0, 1, 2, 3, 4, 5] for the 6-bit multiplexer problem (6-mux) is 7; this is the number of nonterminals in the [0, 1, 2, 3, 4, 5]-ROBDD solution to 6-mux (see figure 1): The reverse ordering has an ISC of 29. Similarly, any [0, 1, 2, 3, 4, 5](R)OBDD has an ISC of 7 for 6-mux, regardless of its actual fitness for 6-mux. So, the objective here is to investigate how differing π, categorised by their ISC values, influence evolvability. To achieve this, the algorithm is run without dynamic variable ordering (i.e., no N3 mutations) for selected ISC categories. The Average Evaluations to a Solution (AES) performance measure is then taken as an indication of the degree of evolvability associated with each ISC category. The actual π under each ISC category are generated randomly. The results are plotted in figure 3. As can be seen clearly, for all problems tested, the trend associated with increasing ISC is increasing AES (poorer evolvability). Furthermore, the trend of increasing AES is greater than linear in ISC, and appears to be approaching exponential. What is concluded from these results is that better π, that is, π having lower ISC values, are associated with much greater evolvability. Knowing that evolvability is associated with low ISC values, however, appears of little use if there is no prior knowledge about which π have low ISC values. For functions such as the multiplexer and adder, optimal π are well-known so a good π can be fixed in advance of running the EA. However, in general, it is not possible to tell in advance which π have low ISC. 2

In [4] the bound parameter was referred to as rate, but is changed here due to potential ambiguity with per-gene mutation that is specified with a probability.

VI (a)

(b) 3−bit adder

16000

2.5

x 10

4−bit adder

5

14000 2

1.5

10000

ISC categories: 20,23,26,29,32,34,38,42 8000

AES

AES

12000

ISC categories: 29,39,49,59,69,79,89,99,105 1

6000 0.5 4000 2000

20

25

30

35

0

40

30

(c)

40

50

60

70

80

90

100

implied solution complexity

implied solution complexity

(d) 6 mux

5000

4

4500

x 10

11 mux

5

3.5

4000 3 3500 2.5

2500

ISC categories: 7,8,9,10,11,12,13,14,19,20,29

2000

AES

AES

3000

2

ISC categories: 15,41,72,100,160,279,509*

1.5

1500 1 1000 0.5

500 0

10

15

20

25

0 0

implied solution complexity

100

200

300

400

500

implied solution complexity

Fig. 3. Evolvability comparison of variable orderings for selected problems. Variable orderings are categorised by their ISC value and sample categories selected to span the entire range for each problem. 100 runs are perfomed for each ISC category. All four graphs exhibit the trend of rapidly increasing AES against increasing ISC value. * In (d) no AES value could be obtained for 509 due to to the extremely poor evolvability of this category.

5

Emergence and variable ordering

In this section it is argued that good π are an emergent property of the extended EBDDIN with dynamic variable ordering. What is meant by ‘emergence’ in this respect is that there is no explicitly introduced incentive in EBDDIN for inducing individuals with below average ISC value. That is, there is no aspect of the fitness function, secondary size-related fitness objective, or mutation-related incentive that explicitly encourages propagation of π with low ISC. Indeed, only the N3 mutation, the swapping of adjacent variables, can influence ISC directly, and the location point for N3 in the genotype is always chosen randomly by variable. Good π arise solely as the logical consequence of being associated with subspaces of genotype space that are more evolvable. That is, individuals possessing π with

VII (a)

(b) generation

generation 1000

2000

100

µ ICS

300

µ fitness

0 0 200

1000

3000

4000

generation 2000 3000

4000

10000

15000

10000

15000

−4 x 10

5

31 −400

µ ISC

µ ISC

E

500

5000

−3

−200

15 400

0 −2

5000

µ fitness

0 15 E

100

400 E 800

190

11−mux

0

5000

20−mux

Fig. 4. The emergence of good π. The population mean (µ) ISC and fitness values are plotted. The population is initialised to random OBDDs having worst π. (a) The main figure shows ISC values for five independent runs on 11-mux. Inset: the single run that undergoes temporary ISC relapse is shown below fitness as an indication of the correlation between ISC and fitness. Within 1000 generations all runs pass expected ISC, E, and stabilise near the optimal of 15. (b) Two runs are shown for 20-mux with fitness alongside ISC. Both runs approach optimal ISC, and remain fairly stable there, while fitness remains in the very early stages of optimisation.

lower ISC values propagate more readily due to the fact that they are more likely to produce fitter offspring. The problems investigated here are the 11-mux (11 inputs, 1 output), 20-mux (20 inputs, 1 ouput) and the 4-bit adder with carry out (8 inputs, 5 outputs). The fitness functions employed on both problems are negated counts of erroneous output bits, so maximum fitness = 0. Optimal ISC is 15, 32 and 29 respectively, and worst ISC is 509, 131,069 and 105 respectively; expected ISC, E, established by frequency sampling, is approximately 49, 564, 72 respectively. A (10, 16) ES is employed for the mux-n problems, and a (15, 50) ES for the adder, so no parents are carried to subsequent generations; no clones are bred either.3 A mutation bound of 1, the minimal, is used for all experiments, as this has been found likely to be the most favourable [5]. The populations are initialised to worst π for mux-n, and randomly for the adder. The results are shown in figures 4 and 5: Note that the vertical scales for ISC are inverted so that correlation with fitness is more easily interpreted, and ISC may be plotted only within the range of primary interest. An interpretation of the results is presented in the remainder of this section. For both mux problems (figure 4), expected ISC is exceeded, and near optimal ISC reached, early on in each run. It is near the optimal where ISC appears most stable. However, there are periods where ISC undergoes temporary relapse, but is soon recovered. In the inset of figure 4(a) this can be seen in more detail, 3

These parameters are not optimised.

VIII

E

4−bit adder

µ ISC

50

E

E

100 0

1000

2000

3000

4000

5000

generation

Fig. 5. 10 runs on the 4-bit adder problem are shown with population initialised to random π. The top inset shows the a single run as ISC below fitness, and a less prominent correlation than for 11-mux. The bottom inset shows the average of all runs. ISC exceeds the expected and stabilises within 1000 generations, but the gain is, respectively, more modest than for 11-mux.

a correlation between ISC and fitness apparent. An increase in ISC appears to be followed by a drop in fitness or slowing in fitness increase, while a drop in ISC appears to be followed by an increase in fitness or rate of increase. While a drop in ISC is accounted for by inherent selection for evolvability, the converse, an increase in ISC (drop in evolvability), can only be the result of random genetic drift, where mutants with high fitness but high ISC (low evolvability) saturate the population temporarily: this behaviour is not unexpected in a small population. In addition, for 20-mux, it can be seen that the near optimal ISC is reached long before fitness is optimised, the population genotype appearing to forge itself into one most evolvable for the fitness function. The results for the adder also exhibit the emergence of π with better than expected ISC (figure 5). The population is this time initialised to random π rather than worst. While better than expected ISC is reached in around 500 generations, ISC appears to remain erratic within a wide range of values whose average is a long way off the optimal of 29, but better than the expected of 72. One run (top inset) does approach the optimal ISC early on, but this is quickly lost and never recovered like it was in for 11-mux. However, in contrast to the single run shown for 11-mux, optimal fitness is maintained during this loss evolvability. This is perhaps accountable, in part, to the larger population which counters the loss of parents in subsequent populations. The apparent difference in the emergence of low ISC π between mux and the adder problem is now discussed. The terrain of ISC values under the N3 mutation is likely to be significant here. Both mux and adder problems are known to have many local optima under direct ISC optimisation using N3. However, the fact that the objective of the fitness function used here is optimised function, not optimised ISC, allows genetic drift to move the search away from the

IX

trappings of what would otherwise be ISC local optima. To give an indication of the comparative ISC terrain, optimal ISC were perturbed for 11-mux and the 4-bit adder, and the corresponding increases in ISC recorded. The results are shown in Table 1. 11-mux is clearly much more robust to perturbations than 4bit adder, which suggest a much smoother ISC terrain for the former. The range of ISC values is 15-509 and 29-105 respectively, which enhances confidence in this conclusion. The frequences of ISC values may also be a factor. Thus, for the adder, the population appears to become ISC-localised due to rugged ISC terrain, which is difficult to navigate under the present scheme. A wider range of range of operators for variable reordering may help smooth the ISC terrain, but this has not been tested. # perturbations 1 5 10 15 11-mux 0.0960 0.4860 1.0350 1.4980 4-bit adder 3.0960 11.3100 17.9850 22.7310 Table 1. ISC robustness to N3 perturbations. The column headers indicate the number of successive perturbations applied to a π with optimal ISC. The values below reflect the corresponding increase in ISC for the two problems, averaged of 1000.

6

Conclusion

The extended EBDDIN with dynamic variable ordering offers a straightforward approach to BDD synthesis where good variable orderings are not known in advance. Near optimal variable orderings can emerge due to the fact that they induce a greater capacity to evolve under this approach: This readily observable property demonstrates the evolution of evolvability, a property which is of significant interest to the EC community. Applications for the synthesis of BDDs representing both fully and incompletely specified functions are expected to benefit, as is the study of evolvability and its emergence. More work needs to be done before EBDDIN, and BDDs in general, find favour within the EC community. However, in this and previous work, some of the potential has begun to be uncovered. Acknowledgements Ata Kaban, Peter Hancox and Stefan Droste.

References 1. Sheldon B. Akers. Binary Decision Diagrams. IEEE Transactions on Computers, C-27(6):509–516, June 1978.

X 2. B. Bollig and I. Wegener. Improving the variable ordering of OBDDs is NPcomplete. IEEE Transactions on Computers, 45(9):993–1002, 1996. 3. Randall E. Bryant. Symbolic boolean manipulation with ordered binary-decision diagrams. ACM Computing Surveys, 24(3):293–318, September 1992. 4. Richard M. Downing. Evolving Binary Decision Diagrams using implicit neutrality. In David Corne, Zbigniew Michalewicz, Marco Dorigo, Gusz Eiben, David Fogel, Carlos Fonseca, Garrison Greenwood, Tan Kay Chen, Guenther Raidl, Ali Zalzala, Simon Lucas, Ben Paechter, Jennifier Willies, Juan J. Merelo Guervos, Eugene Eberbach, Bob McKay, Alastair Channon, Ashutosh Tiwari, L. Gwenn Volkert, Dan Ashlock, and Marc Schoenauer, editors, Proceedings of the 2005 IEEE Congress on Evolutionary Computation, volume 3, pages 2107–2113, Edinburgh, UK, 2-5 September 2005. IEEE Press. 5. Richard M. Downing. Neutrality and gradualism: encouraging exploration and exploitation simultaneously with Binary Decision Diagrams. In (to appear in) Proceedings of the 2006 IEEE Congress on Evolutionary Computation, Vancouver, Canada, 2006. 6. Stefan Droste. Efficient genetic programming for finding good generalizing boolean functions. In John R. Koza, Kalyanmoy Deb, Marco Dorigo, David B. Fogel, Max Garzon, Hitoshi Iba, and Rick L. Riolo, editors, Genetic Programming 1997: Proceedings of the Second Annual Conference, pages 82–87, Stanford University, CA, USA, 13-16 July 1997. Morgan Kaufmann. 7. Stefan Droste, Dominic Heutelbeck, and Ingo Wegener. Distributed hybrid genetic programming for learning boolean functions. In Marc Schoenauer, Kalyanmoy Deb, G¨ unter Rudolph, Xin Yao, Evelyne Lutton, Juan Julian Merelo, and HansPaul Schwefel, editors, Parallel Problem Solving from Nature - PPSN VI 6th International Conference, volume 1917 of LNCS, pages 181–190, Paris, France, 16-20 September 2000. Springer Verlag. 8. Motoo Kimura. The neutral theory of molecular evolution. Cambridge University Press, 1983. 9. Matthias Krause, Petr Savick´ y, and Ingo Wegener. Approximations by OBDDs and the variable ordering problem. In Proc. 26th International Colloquium on Automata, Languages and Programming (ICALP), volume 1644 of LNCS, pages 493–502, 1999. 10. C.Y. Lee. Representation of Switching Circuits by Binary-Decision Programs. Bell Systems Technical Journal, 38:985–999, July 1959. 11. R. Rudell. Dynamic variable ordering for ordered binary decision diagrams. In Proceedings of the International Conference on CAD (ICCAD), pages 42–47, 1993. 12. Hidenori Sakanashi, Tetsuya Higuchi, Hitoshi Iba, and Yukinori Kakazu. Evolution of binary decision diagrams for digital circuit design using genetic programming. In International Conference on Evolvable Systems, pages 470–481, 1996. 13. D. Sieling. On the existence of polynomial time approximation schemes for OBDDMinimization. LNCS, 1373:205–215, 1998. 14. P. van Remortel, T. Lenaerts, and B. Manderick. pages 249–254, Pasadena, California, 19-21 July. Jet Propulsion Laboratory, California Institute of Technology, IEEE Computer Society. 15. Masayuki Yanagiya. Efficient genetic programming based on binary decision diagrams. In 1995 IEEE Conference on Evolutionary Computation, volume 1, pages 234–239, Perth, 29 November - 1 December 1995. IEEE Press.