algorithmdata-structuresimplementationboolean-logicbinary-decision-diagram

Converting binary decision diagram to truth table


Given a binary decision diagram, how do I convert it into a truth table? What is the exact algorithm for it ? I have been trying this for a long time. Here is an example which one can follow:

enter image description here

Source: Wikipedia.

(The dotted edges represent 0; solid edges, 1.)


Solution

  • Beginning at the root node, traverse tree in depth-first manner.

    For each leaf node reached, record an entry in truth table as follows: