Binary decision diagram Created 2026-10-31 Updated 2026-11-05
A directed acyclic graph representing a Boolean function. A decision node tests a Boolean variable and has zero and one successors; evaluation follows the corresponding arrows until a terminal node returns a Boolean value. Sharing subgraphs can make a binary decision diagram much smaller than a binary decision tree.
Binary decision tree Created 2026-10-20 Updated 2026-11-05
A binary decision tree represents a procedure whose internal nodes ask two-outcome questions and whose leaves specify results. A path records the answers obtained so far; its length counts the questions on that execution. Distinguishing possibilities requires at least leaves, so a depth- binary tree can distinguish at most outcomes. This gives for an exact worst-case identification problem. The bound relies on the questions really having only two outcomes; comparisons with an equality branch need a stated convention.
For a complete binary decision tree with variable ordering of a binary decision diagram , first test , then , then on every branch. The four Boolean cofactors after the first two tests are
The eight terminal nodes, read from left to right in the figure, are . The repeated tests are intentional: this is the full binary decision tree before any reduction.
For example, the branch ends at one, whereas ends at zero. This checks the dependence on that must survive the later reduction.
A reduced ordered binary decision diagram is obtained by sharing equal terminal nodes, removing a decision node whose two children are equal, and sharing decision nodes with the same tested Boolean variable and the same ordered pair of children. Apply these rules to the binary decision tree in part (c) as follows.
- Merge the three zero terminal nodes into one zero terminal node, and merge the five one terminal nodes into one one terminal node.
- At the decision node has children . Remove it and redirect its incoming arrow to zero.
- At and the two decision nodes each have children . Remove both and redirect their incoming arrows to one.
- The remaining decision node, at , has children , so retain it.
- The decision node under now has children , while the one under has children . These are different, so neither can be merged or removed. The top decision node also has different children.
The left panel below is therefore the resulting reduced ordered binary decision diagram. Its full description is
Reduced ordered decision diagrams: reversing the given order preserves its size, while testing y first saves one decision node
. Details. The original binary decision diagram also has four decision nodes and two terminal nodes, and is already reduced for : the two decision nodes have different children and no decision node has two equal children. Thus reversing the order has not made this example smaller. Indeed is unchanged by interchanging and , and the new binary decision diagram is the original one with those two labels exchanged. The uniqueness of a reduced ordered binary decision diagram applies to a fixed variable ordering of a binary decision diagram; it does not assert that every ordering has the same size.
On distinct opaque keys, a comparison sorting algorithm must distinguish all input orders. Its binary decision tree has at least leaves, because one fixed permutation of the input positions cannot correctly sort two distinct strict orders. A tree of height has at most leaves. Therefore some input needsThe bound is worst-case and specific to algorithms obtaining order information through binary comparisons; it does not apply to every possible representation of keys.

