Topological sorting & critical path