return a new best-first solver

notes:

  • if heuristic is not defined, this is basically a Dijkstra search.
  • if cost in not defined either, this is basically a breadth-first search.

Property definitions

ai $ SearchProblem :: astar
	# return a new best-first solver
	#
	# notes:
	# * if `heuristic` is not defined, this is basically a Dijkstra search.
	# * if `cost` in not defined either, this is basically a breadth-first search.
	fun astar: SearchSolver[S, A]
	do
		var cpt = new NodeComparator[S, A]
		var todo = new MinHeap[SearchNode[S, A]](cpt)
		var sol = new SearchSolver[S, A](self, todo)
		return sol
	end
lib/ai/search.nit:125,2--136,4