require that even if a tree has no edges, the root must be a node in the nx.DiGraph, and also use the updated nx.topological_sort interface