Javadoc
This method sorts the current set of nodes, if needed. The sort is a simple
DependencyGraph sort, which goes like this:
- All nodes without dependencies become 'roots'
- while roots list is not null
- for each root r
- add r to sorted list
- remove r as a dependency from any other node
- any nodes with no dependencies are added to the roots list