Reduced Ordered Binary Decision Diagram
Reduce a Boolean decision graph and see how variable order affects its size.
By Riano · Published · Updated · Report a correction
Reduced Ordered Binary Decision Diagram
A Binary Decision Diagram (BDD) is a data structure that represents a Boolean function. When the diagram is ordered (variables appear in the same order on all paths) and reduced (isomorphic subgraphs are merged, and nodes with identical children are eliminated), it becomes a canonical Reduced Ordered Binary Decision Diagram (ROBDD).
Building an ROBDD
Let's trace the construction and reduction of an ROBDD for the Multiplexer function (x ? y : z) with variable order xyz. The function evaluates to y when x is true, and z when x is false.
- First, we evaluate the function for all 8 possible assignments of (x, y, z).
- We construct a full binary tree with variable
xat the root,yat the next level, andzat the bottom level. - For the left sub-tree where
x = false, the function value only depends onz. Thus, nodes at theylevel on this side will have identical left and right children (because the value ofydoesn't matter). Theseynodes are eliminated. - For the right sub-tree where
x = true, the function value only depends ony. Theznodes on this side will evaluate to the same terminal regardless ofz, so they are eliminated. - Finally, identical subgraphs are merged. In the end, the graph is reduced to only 3 nonterminal nodes: one for
x, one fory, and one forz.
Expected result: 3 Nonterminal nodes, 2 decisions for evaluating x=false, y=true, z=true (mask 3).
Interactive Experiment
You can experiment with different variable orders and functions using the interactive module athttps://riano.app/module/reduced-ordered-binary-decision-diagram.
- Set Function to "Multiplexer".
- Set Variable order to "xyz". Observe that the graph has 3 nonterminal nodes.
- Change the Variable order to "zxy". Observe that the number of nonterminal nodes increases to 4.
- Set Function to "Parity" and observe the symmetric structure.
- Change Assignment mask to "3" (which sets x=false, y=true, z=true in xyz order depending on binary representation) and follow the highlighted path to the terminal node.
Limitations
While an ROBDD provides a canonical representation of a Boolean function for a fixed variable order, finding the optimal variable order that minimizes the number of nodes is an NP-hard problem. Additionally, some functions, such as integer multiplication, require an exponential number of nodes regardless of the chosen variable order.
Boundary case: Constant functions like "Zero" or "One" do not depend on any variables. Their ROBDD representation reduces entirely to a single terminal node, containing 0 nonterminals.
References
The original algorithm for constructing ROBDDs and manipulating them efficiently was detailed by R.E. Bryant:
Experience it interactively
Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Reduced Ordered Binary Decision Diagram module.
Try Reduced Ordered Binary Decision Diagram on Riano →