Метод на най-доброто спускане (Best-first search)
best_first([[Goal|Path]|_],Goal,FinalPath):-
reverse([Goal|Path],FinalPath).
best_first([Path|List],Goal,FinalPath):-
append(List,NewPaths,NewList),
sort(NewList,Goal,SortedList),
best_first(SortedList,Goal,FinalPath).