Simplification of O((V + E) logV) time complexity

62 Views Asked by At

the time complexity of dijkstra algorithm is O((V + E) logV)

if my graph is E < V like the image I attached below

graph

can I drop the E and simplify it to O(VlogV)?

If can, I would like to know why the E can be ignored?

1

There are 1 best solutions below

4
trincot On

If < , then the expression + is less than 2. That coefficient is not significant for big O notation, so then O(( + ) log) = O(2log) = O(log).