Skip to content

AdaGold/dijkstra

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dijkstra's Algorithm

Dijkstra's algorithm for finding the shortest path from a start node to all other nodes in a graph.

Description

Given an adjacency matrix representation of the graph and the node to start the algorithm from, find the shortest path from a start node to all other nodes in the graph.

Example 1

Input: adjacency_matrix =[ [0, 4, 0, 0], [4, 0, 12, 0], [0, 12, 0, 0], [0, 0, 0, 0] ] Output: { "start_node": 3, "parent_list": [None, None, None, None], "shortest_distances": [float('inf'), float('inf'), float('inf'), 0] }

Note

The unit tests provided don't cover all test cases needed to verify correctness.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 74.8%
  • Dockerfile 24.4%
  • Shell 0.8%