Dijkstra's algorithm implementation using C