PROLOG ASSIGNMENT 3 (SAU).(MIN_COST)
path_C(A, Z, Graph, Path, Cost) :- path1_C(A, [Z], 0, Graph, Path, Cost). path1_C(A, [A|Path1], Cost1, Graph, [A|Path1], Cost1). path1_C(A, [Y|Path1], Cost1, graph(Nodes, Edges), Path, Cost) :- (member(e(X,Y,CostXY), Edges); member(e(Y,X,CostXY), Edges)), not (member(X, Path1)), Cost2 is Cost1 + CostXY, path1_C(A, [X,Y|Path1], Cost2, graph(Nodes, Edges), Path, Cost). shortest_path(A, Z, Graph, Path, Mini_Cost) :- path_C(A, Z, Graph, Path, Mini_Cost), no_shorter_path(A, Z, Graph, Path1, Cost1, Mini_Cost). no_shorter_path(A, Z, Graph, Path, Cost, Mini_Cost) :- ...