For a graph with v
vertices and e
edges, and a fringe stored in a binary min heap, the worst case runtime is O((n+e)lg(n))
. However, this is assuming we use a adjacency linked list to represent the graph. Using a adjacency matrix takes O(n^2)
to traverse, while a linked list representation can be traversed in O(n+e)
.
Therefore, would using the matrix to represent the graph change the runtime of Dijkstra's to O(n^2lg(n))
?