Uses Kahn's algorithm to topologically sort the nodes in the graph
This overload is only used for internal purposes
Optional
Uses Kahn's algorithm to topologically sort the nodes in the graph