in short: How to find min value in a list? (thanks for the advise kaarel)
long story:
I have created a weighted graph in amzi prolog and given 2 nodes, I am
This looks right to me (from here).
min_in_list([Min],Min). % We've found the minimum min_in_list([H,K|T],M) :- H =< K, % H is less than or equal to K min_in_list([H|T],M). % so use H min_in_list([H,K|T],M) :- H > K, % H is greater than K min_in_list([K|T],M). % so use K