trickster.search
¶

trickster.search.
a_star_search
(start_node, expand_fn, goal_fn, heuristic_fn=None, hash_fn=None, iter_lim=None, beam_size=None, return_path=False)¶ Generalized A* search with no beam size limit.

trickster.search.
generalized_a_star_search
(start_node, expand_fn, goal_fn, heuristic_fn=None, hash_fn=None, iter_lim=None, beam_size=None, return_path=False)¶ Generalized A* search.
Returns the tuple (cost, target_node) if return_path is set to False. Otherwise, returns the target node, the costs of nodes expanded by the algorithm, and the optimal path from the initial node to the target node.
Parameters:  start_node – Initial node.
 expand_fn – Returns an iterable of tuples (neighbour, cost).
 goal_fn – Returns True if the current node is the target node.
 heuristic_fn – Returns an estimate of the cost to the target node. By default, is a constant 0.
 hash_fn – Hash function for nodes. By default equals the identity function f(x) = x.
 iter_lim – Maximum number of iterations to try.
 beam_size – Beam size. Turns the search into beam search.
 return_path – Whether to return the optimal path from the initial node to the target node. By default equals False.

trickster.search.
ida_star_search
(start_node, expand_fn, goal_fn, heuristic_fn=None, hash_fn=None, iter_lim=None, return_path=False)¶ IDA* search.
Returns the tuple (cost, target_node) if return_path is set to False. Otherwise, returns the target node, the costs of nodes expanded by the algorithm, and the optimal path from the initial node to the target node.
Parameters:  start_node – Initial node.
 expand_fn – Returns an iterable of tuples (neighbour, cost).
 goal_fn – Returns True if the current node is the target node.
 heuristic_fn – Returns an estimate of the cost to the target node. By default, is a constant 0.
 hash_fn – Hash function for nodes. By default equals the identity function f(x) = x.
 iter_lim – Maximum number of iterations to try.
 return_path – Whether to return the optimal path from the initial node to the target node. By default equals False.