Prims Algorithm Total Duration!

"Thus, the total time for the Prim algorithm is O (V log V + E log V) = O (E log V), which is asymptotically the same as for our implementation of the Kruskal algorithm."

From http://serverbob.3x.ro/IA/DDU0137.html

But why is O (V log V + E log V) = O (E log V) ??

Is it because E is at least V-1?

+6
source share
2 answers

Since in the normal case we assume that E is greater than V. Thus, ignoring the members of the lower order, we obtain E lg V

+3
source

In particular, E can be a maximum of V ^ 2 in a directed graph. If we take E = v ^ 2 (to account for the worst case), E swallows V.

+1
source

Source: https://habr.com/ru/post/890555/


All Articles