Question: Let G be a directed, edge-weighted graph such that every edge has a weight that belongs to the set {0, 1, ..., W}, where W

Let G be a directed, edge-weighted graph such that every edge has a weight that belongs to the set {0, 1, ..., W}, where W is a non-negative integer. Think of W as being a small constant, say 10. This problem asks you to take advantage of this special property of the edge weights to make Dijkstra's algorithm run faster than its current running time of O (m log n)? Specifically, modify the implementation of Dijkstra's algorithm so that the SSSP problem can be solved in O (n middot W + m) time for a graph with n vertices and m edges. After presenting your new algorithm present an analysis showing that its running time is O (n middot W + m)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
