| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is #2060 with conflicts resolved. Fixes #2060
This commit adds two new functions and an example application using
those functions.
- The `prefix_tree` function (in the new module
`networkx/generators/trees.py`) generates a prefix tree (aka a trie)
from a given list of strings (or integers, etc.).
- The `dag_to_branching` function in `networkx/algorithms/dag.py`
creates the branching that results from interpreting the list of all
paths from root nodes to leaf nodes in the DAG as the root-to-leaf
paths in a prefix tree.
- The example application of the `dag_to_branching` function, in the
`examples/applications/circuits.py` module, demonstrates how to
convert a Boolean circuit into an equivalent Boolean formula.
|