Graph Algorithms

Dijkstra's Algorithm

Find shortest paths from a source node to all other nodes using a greedy approach. Works with non-negative edge weights.

Input Graph

Enter edges as: from to weight (one per line)

Each line represents an edge: source destination weight. Enter the starting node for shortest paths.

Trace

Step-by-step execution showing node visits and distance updates.

  1. Run the algorithm to populate steps.