Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Initialize TreeSearch class.
@type board: Map @param board: Map to be solved @type bfs: boolean @param bfs: Whether this class will use breadth-first search or depth-first search @rtype: TreeSearch @return: Initialized TreeSearch class """
""" Populate the queue with nodes and their cost.
@type graph: Map @param graph: Graph to get moves from to populate queue @type move: Move @param move: Move to get to the @type queue: Queue @param queue: Stack with nodes being added to it with the cost @type parent: Node @param parent: Parent for the nodes that will be created """ # get possible moves
# create node
# put into queue all the moves possible
""" Get the best path to solve the given graph.
@rtype: [Move] @return: Array of moves which represent the path found to solve the puzzle """
# decide on the data structure to use which determines if breadth-first search # or depth-first search is being run. else:
|