implementation of Dijkstra's algorithm for school project