Professional Documents
Culture Documents
Network Science L2 - Part 3
Network Science L2 - Part 3
Lesson 2 Part 3
DAG
● For a weighted network where the weight of each edge represents its "length" or
"cost," Dijkstra's algorithm can be used to compute the shortest path from a
source node s to any other node.
● It's important to note that Dijkstra's algorithm is applicable only when the weights
are positive.
● The key idea in the algorithm is to select, in each iteration, the node m with the
minimum known distance from s. This distance cannot be further reduced in
subsequent iterations.
● The algorithm then updates the minimum known distance to every unexplored
neighbor of m if it is larger than the distance from s to m plus the cost of the edge
from m to the neighbor.
● If the network is weighted and includes negative weights, Dijkstra's algorithm is
not suitable. Instead, the Bellman-Ford algorithm can be used, which is a classic
example of dynamic programming.
● The running time of the Bellman-Ford algorithm is O(m*n), where m is the
number of edges and n is the number of nodes.
● In contrast, the running time of Dijkstra's algorithm is O((m + n) log n) if a
Fibonacci heap is used to identify the node with the minimum distance from s in
each iteration of the loop.
●