Tag: greedy algorithm

Dijkstra’s Algorithm in JavaScript, slow implementation
Dijkstra’s Algorithm is a handy tool for figuring out the shortest path in a connected directed graph where each connection has a nonnegative weight. If you’re familiar with Prim’s Minimum Spanning Tree, despite having different goals, you’ll observe that both employ a greedy strategy to carefully select the optimal/smallest distance path step by step. Note:…