Texas Instruments interview question

Dijkstra algorithm with a slight modification