﻿==================================================
4. DIJKSTRA'S ALGORITHM
==================================================

ALGORITHM:
1. Initialize all distances to INF.
2. Set source distance = 0.
3. Mark all vertices as unvisited.
4. Select the unvisited vertex with minimum distance.
5. Mark the selected vertex as visited.
6. Check all adjacent vertices.
7. Update distance if a shorter path is found.
8. Repeat until all reachable vertices are processed.
9. Use prev[] to reconstruct the shortest path.

FORMULA:
dist[v] = min(dist[v], dist[u] + weight[u][v])

RECURRENCE:
Not recursive. Uses Greedy technique.

TIME COMPLEXITY (ADJACENCY MATRIX):
Best Case    : O(V^2)
Average Case : O(V^2)
Worst Case   : O(V^2)
Space        : O(V) auxiliary space

IMPORTANT:
1. Dijkstra requires non-negative edge weights.