Implementation in prolog of Dijkstra's algorithm for finding the shortest path in a directed acyclic graph with non-negative weight