A simple implementation of Dijkstra's algorithm in C