Traverses InOutIndicesRemaining in search of the first RootNode's node that has no dependencies left. Once found the node's index gets added to OutNodeIndices, removed from dependency lists from all other nodes and the function quits.