Use LinkedHashMap so that the topological sort will process the nodes in the same order of collecting