In computer science, a binary decision diagram (BDD) or branching
program is a data structure that is used to represent a Boolean
function. On a more abstract level, BDDs can be considered as a
compressed representation of sets or relations. Unlike other
compressed representations, operations are performed directly on the
compressed representation, i.e. without decompression. Other data
structures used to represent a
Contents 1 Definition 1.1 Example 2 History 3 Applications 4 Variable ordering 5 Logical operations on BDDs 6 See also 7 References 8 Further reading 9 External links Definition[edit]
A
N displaystyle N is labeled by Boolean variable V N displaystyle V_ N and has two child nodes called low child and high child. The edge from node V N displaystyle V_ N to a low (or high) child represents an assignment of V N displaystyle V_ N to 0 (resp. 1). Such a BDD is called 'ordered' if different variables appear in the same order on all paths from the root. A BDD is said to be 'reduced' if the following two rules have been applied to its graph: Merge any isomorphic subgraphs. Eliminate any node whose two children are isomorphic. In popular usage, the term BDD almost always refers to Reduced Ordered Binary Decision Diagram (ROBDD in the literature, used when the ordering and reduction aspects need to be emphasized). The advantage of an ROBDD is that it is canonical (unique) for a particular function and variable order.[1] This property makes it useful in functional equivalence checking and other operations like functional technology mapping. A path from the root node to the 1-terminal represents a (possibly partial) variable assignment for which the represented Boolean function is true. As the path descends to a low (or high) child from a node, then that node's variable is assigned to 0 (resp. 1). Example[edit] The left figure below shows a binary decision tree (the reduction rules are not applied), and a truth table, each representing the function f (x1, x2, x3). In the tree on the left, the value of the function can be determined for a given variable assignment by following a path down the graph to a terminal. In the figures below, dotted lines represent edges to a low child, while solid lines represent edges to a high child. Therefore, to find (x1=0, x2=1, x3=1), begin at x1, traverse down the dotted line to x2 (since x1 has an assignment to 0), then down two solid lines (since x2 and x3 each have an assignment to one). This leads to the terminal 1, which is the value of f (x1=0, x2=1, x3=1). The binary decision tree of the left figure can be transformed into a binary decision diagram by maximally reducing it according to the two reduction rules. The resulting BDD is shown in the right figure. Binary decision tree and truth table for the function f ( x 1 , x 2 , x 3 ) = x ¯ 1 x ¯ 2 x ¯ 3 + x 1 x 2 + x 2 x 3 displaystyle f(x_ 1 ,x_ 2 ,x_ 3 )= bar x _ 1 bar x _ 2 bar x _ 3 +x_ 1 x_ 2 +x_ 2 x_ 3 BDD for the function f History[edit]
The basic idea from which the data structure was created is the
Shannon expansion. A switching function is split into two
sub-functions (cofactors) by assigning one variable (cf. if-then-else
normal form). If such a sub-function is considered as a sub-tree, it
can be represented by a binary decision tree. Binary decision diagrams
(BDD) were introduced by Lee,[2] and further studied and made known by
Akers[3] and Boute.[4]
The full potential for efficient algorithms based on the data
structure was investigated by
f ( x 1 , … , x n ) displaystyle f(x_ 1 ,ldots ,x_ n ) for which depending upon the ordering of the variables we would end
up getting a graph whose number of nodes would be linear (in n)
at the best and exponential at the worst case (e.g., a ripple carry
adder). Let us consider the
f ( x 1 , … , x 2 n ) = x 1 x 2 + x 3 x 4 + ⋯ + x 2 n − 1 x 2 n . displaystyle f(x_ 1 ,ldots ,x_ 2n )=x_ 1 x_ 2 +x_ 3 x_ 4 +cdots +x_ 2n-1 x_ 2n . Using the variable ordering x 1 < x 3 < ⋯ < x 2 n − 1 < x 2 < x 4 < ⋯ < x 2 n displaystyle x_ 1 <x_ 3 <cdots <x_ 2n-1 <x_ 2 <x_ 4 <cdots <x_ 2n , the BDD needs 2n+1 nodes to represent the function. Using the ordering x 1 < x 2 < x 3 < x 4 < ⋯ < x 2 n − 1 < x 2 n displaystyle x_ 1 <x_ 2 <x_ 3 <x_ 4 <cdots <x_ 2n-1 <x_ 2n , the BDD consists of 2n + 2 nodes. BDD for the function ƒ(x1, ..., x8) = x1x2 + x3x4 + x5x6 + x7x8 using bad variable ordering Good variable ordering It is of crucial importance to care about variable ordering when
applying this data structure in practice. The problem of finding the
best variable ordering is NP-hard.[11] For any constant
c > 1 it is even
n displaystyle n -bit numbers does not have an OBDD smaller than 2 ⌊ n / 2 ⌋ / 61 − 4 displaystyle 2^ lfloor n/2rfloor /61-4 vertices.[14] (If the multiplication function had polynomial-size OBDDs, it would show that integer factorization is in P/poly, which is not known to be true.[15]) Researchers have suggested refinements on the BDD data structure giving way to a number of related graphs, such as BMD (binary moment diagrams), ZDD (zero-suppressed decision diagram), FDD (free binary decision diagrams), PDD (parity decision diagrams), and MTBDDs (multiple terminal BDDs). Logical operations on BDDs[edit] Many logical operations on BDDs can be implemented by polynomial-time graph manipulation algorithms:[16]:20 conjunction disjunction negation existential abstraction[citation needed] universal abstraction[citation needed] However, repeating these operations several times, for example forming
the conjunction or disjunction of a set of BDDs, may in the worst case
result in an exponentially big BDD. This is because any of the
preceding operations for two BDDs may result in a BDD with a size
proportional to the product of the BDDs' sizes, and consequently for
several BDDs the size may be exponential. Also, since constructing the
BDD of a
Boolean satisfiability problem L/poly, a complexity class that captures the complexity of problems with polynomially sized BDDs Model checking Radix tree Barrington's theorem References[edit] ^ a b Graph-Based Algorithms for Boolean Function Manipulation, Randal
E. Bryant, 1986
^ C. Y. Lee. "Representation of Switching Circuits by Binary-Decision
Programs". Bell System Technical Journal, 38:985–999, 1959.
^ Sheldon B. Akers, Jr.. Binary Decision Diagrams, IEEE Transactions
on Computers, C-27(6):509–516, June 1978.
^ Raymond T. Boute, "The Binary Decision Machine as a programmable
controller".
R. Ubar, "Test Generation for Digital Circuits Using Alternative Graphs (in Russian)", in Proc. Tallinn Technical University, 1976, No.409, Tallinn Technical University, Tallinn, Estonia, pp. 75–81. Further reading[edit] D. E. Knuth, "
External links[edit] Wikimedia Commons has media related to Binary decision diagrams. Fun With Binary Decision Diagrams (BDDs), lecture by Donald Knuth List of BDD software libraries for several programming languages. v t e Data structures Types Collection Container Abstract Associative array Multimap List Stack Queue Double-ended queue Priority queue Double-ended priority queue Set Multiset Disjoint-set Arrays Bit array Circular buffer Dynamic array Hash table Hashed array tree Sparse matrix Linked Association list Linked list Skip list Unrolled linked list XOR linked list Trees B-tree Binary search tree AA tree AVL tree Red–black tree Self-balancing tree Splay tree Heap Binary heap Binomial heap Fibonacci heap R-tree R* tree R+ tree Hilbert R-tree Trie Hash tree Graphs Binary decision diagram Directed acyclic graph Directed acyclic word graph List |