dijkstra tag

2 questions


1 answers
401 views
0
Dijkstra shortest path

I want to print out the shortest path length using Dyxtra, so could you tell me what the output code is? I know the route, but I don't know how to get the length.

1 years ago

1 answers
141 views
0
I would like to ask you a question about analyzing the example code that implements the Dijkstra algorithm in Python. (Help me!!!))

graph = {}graph[start] = {}graph[start][a] = 6graph[start][b] = 2graph[a] = {fin: 1} # graph[a][fin] = 1graph[b] = {a: 3, fin: 5} # graph[b][a] = 3 graph[b][fin] = 5graph[fin] = {}# Hash table that st...


© 2024 OneMinuteCode. All rights reserved.