{"version":"1.0","type":"rich","title":"Python implementation of Dijkstra's Algorithm","description":"This example shows a Python implementation of Dijkstra's shortest-path algorithm operating on a graph with weighted edges. It defines a `Graph` class that stores nodes, edges, and distances, then uses the `dijsktra` function to compute the minimum distance from a starting node to all others, returning both the visited distances and the path map. The code relies on Python’s `defaultdict` for edge adjacency and a set-based node collection to iteratively select the unvisited node with the smallest known distance. The visualization itself is not rendered—only the algorithm’s logic and data structures are presented in plain code.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-d932a2b3028f836194db7cb3ffd49334?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}