I knew the time complexity of Topological ordering is O(V+E) since we don't need to do sorting during the selection of node whose incoming degree is 0. But what about the least topological ordering that make sure every node to delete is always the least one of the List of 0 incoming degree nodes.
Like the picture show below, "1 2 4 3 5" and "2 1 4 3 5" are both topological ordering but the least one is "1 2 4 3 5".
enter image description here
I store the 0 incoming degree nodes in a priority queue(min-Heap) and delete the top of it every time. So there are totally V nodes to delete and every delete needs the priority queue O(log V) to adjust to keep itself a min-Heap. It seems that the total node deletion is O(VlogV) while the basic topological ordering is O(V+E). What is the exactly time complexity of The least topological ordering? Is it O(VlogV+E)? Hope you can help me!