DOC : fixed minor error in using topological sort

`topological_sort` is a function in `nx` not an instance method
of a directed graph.
Merge pull request #5462 from tacaswell/dag_docfix

DOC : fixed minor error in using topological sort