ArticleslgStudy

mathematics

Binary decision diagram

Binary decision diagram is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Binary decision diagram rather than just read about it. In short: 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.

Binary decision diagram — main illustration
Binary decision diagram — illustration

Key takeaways

  • Binary decision diagram belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Binary decision diagram to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Binary decision diagram from memory before moving on to harder problems.

Reference excerpt

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. Similar data structures include negation normal form (NNF), Zhegalkin polynomials, and propositional directed acyclic graphs (PDAG).

Definition A Boolean function can be represented as a rooted, directed, acyclic graph, which consists of several (decision) nodes and two terminal nodes. The two terminal nodes are labeled 0 (FALSE) and 1 (TRUE). Each (decision) node u is labeled by a Boolean variable xi and has two child nodes called low child and high child. The edge from node u to a low (or high) child represents an assignment of the value FALSE (or TRUE, respectively) to variable xi. 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 up to isomorphism) for a particular function and variable order. 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 (respectively 1).

Example 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 f(0,1,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(0,1,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.

Another notation for writing this Boolean function is x‾1x‾2x‾3+x1x2+x2x3.

Complemented edges

An ROBDD can be represented even more compactly, using complemented edges, also known as complement links. The resulting BDD is sometimes known as a typed BDD or signed BDD. Complemented edges are formed by annotating low edges as complemented or not. If an edge is complemented, then it refers to the negation of the Boolean function that corresponds to the node that the edge points to (the Boolean function represented by the BDD with root that node). High edges are not complemented, in order to ensure that the resulting BDD representation is a canonical form. In this representation, BDDs have a single leaf node, for reasons explained below. Two advantages of using complemented edges when representing BDDs are:

computing the negation of a BDD takes constant time space usage (i.e., required memory) is reduced (by a factor at most 2) However, Knuth argues otherwise:

Although such links are used by all the major BDD packages, they are hard to recommend because the computer programs become much more complicated. The memory saving is usually negligible, and never better than a factor of 2; furthermore, the author's experiments show little gain in running time. A reference to a BDD in this representation is a (possibly complemented) "edge" that points to the root of the BDD. This is in contrast to a reference to a BDD in the representation without use of complemented edges, which is the root node of the BDD. The reason why a reference in this representation needs to be an edge is that for each Boolean function, the function and its negation are represented by an edge to the root of a BDD, and a complemented edge to the root of the same BDD. This is why negation takes constant time. It also explains why a single leaf node suffices: FALSE is represented by a complemented edge that points to the leaf node, and TRUE is represented by an ordinary edge (i.e., not complemented) that points to the leaf node. For example, assume that a Boolean function is represented with a BDD represented using complemented edges. To find the value of the Boolean function for a given assignment of (Boolean) values to the variables, we start at the reference edge, which points to the BDD's root, and follow the path that is defined by the given variable values (following a low edge if the variable that labels a node equals FALSE, and following the high edge if the variable that labels a node equals TRUE), until we reach the leaf node. While following this path, we count how many complemented edges we have traversed. If when we reach the leaf node we have crossed an odd number of complemented edges, then the value of the Boolean function for the given variable assignment is FALSE, otherwise (if we have crossed an even number of complemented edges), then the value of the Boolean function for the given variable assignment is TRUE. An example diagram of a BDD in this representation is shown on the right, and represents the same Boolean expression as shown in diagrams above, i.e., (¬x1∧¬x2∧¬x3)∨(x1∧x2)∨(x2∧x3). Low edges are dashed, high edges solid, and complemented edges are signified by a circle at their source. The node with the @ symbol represents the reference to the BDD, i.e., the reference edge is the edge that starts from this node.

… excerpt ends here. Continue reading the full article.

Illustrations

Binary decision diagram: BDD for the function f
BDD for the function f
Binary decision diagram: Representation of a binary decision diagram using complemented edges
Representation of a binary decision diagram using complemented edges
Binary decision diagram: BDD for the function ƒ(x1, ..., x8) = x1x2 + x3x4 + x5x6 + x7x8 using bad variable ordering
BDD for the function ƒ(x1, ..., x8) = x1x2 + x3x4 + x5x6 + x7x8 using bad variable ordering
Binary decision diagram: Good variable ordering
Good variable ordering

Worked examples

Example 1 — a first encounter with Binary decision diagram

Start with the simplest possible case. Write down what Binary decision diagram claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Binary decision diagram before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Binary decision diagram ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Binary decision diagram

In research
Binary decision diagram appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Binary decision diagram in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Binary decision diagram is common in secondary-school and first-year university syllabi. It links to neighbouring topics Boolean algebra, Diagrams, Graph data structures, so understanding it makes those chapters shorter.
In everyday life
Look for Binary decision diagram outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Binary decision diagram” →

How to study Binary decision diagram in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Binary decision diagram means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Binary decision diagram out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Binary decision diagram in simple terms?

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.

Why does Binary decision diagram matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Binary decision diagram?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Binary decision diagram.

Tags

  • Boolean algebra
  • Diagrams
  • Graph data structures
  • Knowledge compilation
  • Model checking

Keep exploring