This document describes Dijkstra's algorithm for finding the shortest paths between nodes in a graph. It provides an example graph with 7 nodes labeled A through G and weighted edges. The algorithm works by first setting the distance and previous node for each node to infinity and unknown respectively, except the starting node which is set to 0. It then repeatedly selects the closest unknown node, marks it as known, and updates the distances and previous nodes for any unknown neighbors if a shorter path is found through the known node.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
49 views
Dijkdtra Algorithm
This document describes Dijkstra's algorithm for finding the shortest paths between nodes in a graph. It provides an example graph with 7 nodes labeled A through G and weighted edges. The algorithm works by first setting the distance and previous node for each node to infinity and unknown respectively, except the starting node which is set to 0. It then repeatedly selects the closest unknown node, marks it as known, and updates the distances and previous nodes for any unknown neighbors if a shorter path is found through the known node.