sort orders to resolve dependencies by topological sort using depth first search