3 | Searching for solutions Flashcards
What is heuristic knowledge?
The difficulty of search and the fact that humans are able to solve some search problems efficiently suggests that computer agents should exploit knowledge about special cases to guide them to a solution. This extra knowledge beyond the search space is called heuristic knowledge.
What is a state space?
One general formulation of intelligent action is in terms of a state space. A state contains all of the information necessary to predict the effects of an action and to determine whether a state satisfies the goal. State-space searching assumes:
- The agent has perfect knowledge of the state space and is planning for the case where it observes what state it is in: there is full observability.
- The agent has a set of actions that have known deterministic effects.
- The agent can determine whether a state satisfies the goal.
What is a solution?
A solution is a sequence of actions that will get the agent from its current state to a state that satisfies the goal.
What does a state-space problem consists of?
- a set of states
- a distinguished state called the start state
- for each state, a set of actions available to the agent in that state
- an action function that, given a state and an action, returns a new state
- a goal specified as a Boolean function, goal(s), that is true when state s satisfies the goal, in which case we say that s is a goal state
- a criterion that specifies the quality of an acceptable solution. For example, any sequence of actions that gets the agent to the goal state may be acceptable, or there may be costs associated with actions and the agent may be required to find a sequence that has minimal total cost. A solution that is best according to some criterion is called an optimal solution. We do not always need an optimal solution, for example, we may be satisfied with any solution that is within 10% of optimal.
What does a directed graph consist of?
a set N of nodes and a set A of arcs, where an arc is an ordered pair of nodes.
What is a cycle (in terms of graphs)?
A cycle is a nonempty path where the end node is the same as the start node
What is a directed graph without any cycles called?
directed acyclic graph (DAG)
What is the forward branching factor (in terms of graphs)?
the number of outgoing arcs from the node.
What is the backward branching factor (in terms of graphs)?
the number of incoming arcs to the node.
What is the concept of the generic search algorithm?
The intuitive idea behind the generic search algorithm, given a graph, a start node, and a goal predicate, is to explore paths incrementally from the start node. This is done by maintaining a frontier (or fringe) of paths from the start node. The frontier contains all of the paths that could form initial segments of paths from the start node to a goal node. (See Figure 3.3, where the frontier is the set of paths to the gray shaded nodes.) Initially, the frontier contains the trivial path containing just the start node, and no arcs. As the search proceeds, the frontier expands into the unexplored nodes until a goal node is encountered.
What is the breadth-first search algorithm?
In breadth-first search the frontier is implemented as a FIFO (first-in, first-out) queue. Thus, the path that is selected from the frontier is the one that was added earliest.
This approach implies that the paths from the start node are generated in order of the number of arcs in the path. One of the paths with the fewest arcs is selected at each iteration.
When is the breadth-first search algorithm useful?
the problem is small enough so that space is not a problem (e.g., if you already need to store the graph) and you want a solution containing the fewest arcs.
What is the depth-first search algorithm?
In depth-first search, the frontier acts like a LIFO (last-in, first-out) stack of paths. In a stack, elements are added and removed from the top of the stack. Using a stack means that the path selected and removed from the frontier at any time is the last path that was added.
When is the depth-first search algorithm useful?
space is restricted
many solutions exist, perhaps with long paths, particularly for the case where nearly all paths lead to a solution or
the order in which the neighbors of a node are added to the stack can be tuned so that solutions are found on the first try.
When is the depth-first search algorithm a poor method?
it is possible to get caught in infinite paths, which occurs when the graph is infinite or when there are cycles in the graph
solutions exist at shallow depth, because in this case the search may explore many long paths before finding the short solutions, or
there are multiple paths to a node, for example, on a n×n
grid, where all arcs go right or down, there are exponentially paths from the top-left node, but only n2 nodes.