Build networkx dependency tree from YAML definition.