- Introduced by
- Randal Bryant
- Year
- 1986
- Type
- Compact Boolean function representation
- Family
- Symbolic Computation
What does it do?
Binary Decision Diagrams (BDDs) are a graph-based representation of Boolean functions, introduced by Randal Bryant in 1986.
A BDD is a directed acyclic graph in which each internal node tests one variable and has a 0-branch and a 1-branch leading to terminal nodes. For a fixed variable ordering, the reduced form of a function is unique, which makes equivalence checking straightforward and allows Boolean operations to be carried out directly on the graphs; this underpins their use in model checking, circuit verification and symbolic computation.
The intuition behind the method
A BDD starts from a decision tree for a Boolean function, in which each node tests a variable and follows either the 0 or the 1 branch. Identical subgraphs are shared and redundant tests are removed, so the diagram can be much smaller than the full tree. Bryant's 1986 analysis notes that a function may still need a graph exponential in its number of arguments in the worst case, but many functions met in practice have compact representations. Boolean operations such as AND and OR are then computed by working on the graphs themselves, without listing every input assignment.
History
Randal Bryant introduced reduced ordered BDDs in 1986, in a paper that presented the representation together with manipulation algorithms and experimental results from logic design verification. The time complexity of the algorithms is proportional to the sizes of the graphs they operate on. The representation later became a standard tool in symbolic model checking and hardware verification.
When to use it
Use BDDs when the Boolean function or system has structure that keeps the diagram compact, such as symbolic state-space exploration, equivalence checking of combinational circuits, or finite-state model checking with a manageable number of variables. The method assumes a function over a finite set of Boolean variables, with a variable ordering that is either fixed in advance or reordered during construction; the size of the result depends on that ordering. If the node count grows large during construction, the ordering or the problem formulation is unsuited to the diagram: try a different ordering, decompose the problem, or switch to a SAT or SMT solver. Avoid BDDs for functions with little structure or for arithmetic-heavy constraints, where the diagram can grow exponentially in size and exhaust memory before producing a result. For such problems, SAT or SMT solvers are often a better fit.
Limitations and considerations
- Variable ordering is critical: a poor ordering can cause the diagram to grow exponentially, and finding an optimal ordering is computationally hard
- Worst-case blow-up: as Bryant's analysis notes, some functions need a graph exponential in the number of arguments; integer multiplication is a known difficult case, where the diagrams for its output bits grow rapidly with operand width
- Poor fit for arithmetic: integer operations expressed as Boolean functions often produce very large diagrams
- Unpredictable size: diagram size can change sharply with small modifications to the problem or the ordering, and reordering heuristics are problem-specific
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Canonical form: for a fixed variable ordering, each Boolean function has a unique reduced BDD, so two functions can be compared for equivalence by comparing their diagrams
- Compact storage for structured functions: many practically occurring functions have diagrams far smaller than their truth tables, even though the number of variables is large
- Operations on the diagrams: Boolean combinations and quantification are computed on the graphs, and the cost is governed by the sizes of the diagrams being combined, as Bryant's algorithms show
- Symbolic sets: a BDD can represent a whole set of states at once, so properties of that set can be checked by Boolean operations rather than by enumerating states one at a time
Applications
- Circuit verification: checking that combinational circuits and memory structures in hardware designs satisfy their specifications
- Model checking: verifying finite-state systems for safety and liveness properties
- Boolean constraint reasoning on problems with compact structure, where SAT-based methods are a common alternative
- Formal verification of protocols, where the set of reachable states is represented symbolically
- Configuration management: representing product-feature constraints and enumerating valid configurations
How it works
How it works
Fix a variable ordering, which determines the order of tests from root to terminals and strongly affects the final size, and set up the node table that keeps the diagram reduced.
Build the reduced diagram by recursive Shannon expansion, f = (¬x ∧ f|x=0) ∨ (x ∧ f|x=1), creating a node for each variable test and applying the reduction rules: remove any node whose two children are the same, and share any nodes that are identical (same variable, same children).
Evaluate the diagram for a given assignment by starting at the root and following the 0 or 1 branch dictated by each tested variable's value until a terminal node is reached; the terminal gives the function value.
Assess the diagram by its node count, which is the measure of the memory it requires, and by traversing it for particular assignments to read off the function value.
Common pitfalls
- Choosing an arbitrary variable order; dynamic reordering or an ordering guided by the structure of the problem is usually needed
- Applying BDDs to integer constraint solving or other arithmetic-heavy problems; SAT, SMT or other methods are usually more suitable
- Not caching intermediate results (the computed table); repeated subproblems during Boolean operations can dominate the runtime
- Running out of memory before a result is reached; set limits on diagram size and consider decomposition of the problem
Frequently asked questions
What is variable ordering and why does it matter so much?
Variable ordering is the sequence in which variables are tested from the root to the terminals. The same function can have a much smaller diagram under one ordering than under another, so ordering is often the main factor in whether a BDD is practical. Dynamic reordering methods search for better orderings during construction, and orderings that follow the structure of the problem are a common starting point.
What is the reduction step in BDD construction?
After each Shannon expansion, f = (¬x ∧ f|x=0) ∨ (x ∧ f|x=1), two rules are applied. A node whose 0- and 1-children are the same is redundant and is removed, with its incoming edges redirected to the child. Nodes that test the same variable and have identical children are isomorphic, and they are merged into one shared node. Both rules preserve the function while shrinking the graph.
How do I perform Boolean operations (AND, OR) on two BDDs?
The standard approach is a recursive procedure that walks both diagrams together, branching on the top variable of each and combining the results at the terminals. Results of subproblems are stored in a computed table so that they are not recomputed. The running time depends on the sizes of the operand diagrams, and the result can be larger than either input.
When does BDD size become impractical, and what are the alternatives?
For some functions the diagram is exponential in the number of input variables, and the method becomes impractical. Integer multiplication is a known difficult case, where the diagrams for the output bits grow rapidly with operand width. Alternatives include SAT solvers, which avoid building an explicit diagram of the whole function, and SMT solvers with bit-vector theories for arithmetic constraints. Hybrid approaches that combine BDDs for structured parts with other solvers for arithmetic parts are sometimes used.
Sources
Bryant, R. E. (1986). Graph-based algorithms for Boolean function manipulation. IEEE Transactions on Computers, 35(8), 677–691.
Open DOI referenceAndersen, H. R. (1997). An introduction to binary decision diagrams. Technical Report, IT University of Copenhagen.
Open publication referenceBecker, B., & Drechsler, R. (1998). Binary Decision Diagrams: Theory and Implementation. Kluwer.
ISBN: 0792380185