Wrong definition of rule: use max instead of min in aggregate:
maximum_path(From, To, Path, Weight) :-
aggregate(min(W, P), path(From, To, P, W), min(Weight, Path)).
Wrong definition of rule: use max instead of min in aggregate:
maximum_path(From, To, Path, Weight) :-
aggregate(min(W, P), path(From, To, P, W), min(Weight, Path)).