• No se han encontrado resultados

Best-first search strategies are useful when different solutions of a problem have different values. For example, assuming that the fox in our story judges that having the crow’s cheese is more valuable than making her own food, she could use best-first search to guide her search for the best solution.

To use best-first search, you need to be able to evaluate and compare different solutions. For example, if you want to go from A to B, then you might prefer a travel plan that takes the least time, costs the least money or causes the least harm to the environment. No single plan is likely to be best for all of these attributes, so you may have to weigh and trade one attribute off against the other. Given such weights, you can use the weighted sum of the values of the attributes as a single measure of the overall value of a solution.

It is often possible to extend the measure of the value of a complete solution to a measure of the value of a partial solution. For example, suppose you want to travel from Bridgeport in Connecticut to Petworth in England, and you are exploring a partial travel plan that involvesflying from New York to London, but haven’t figured out the rest of the plan. You know that the best cost of any complete travel plan that extends the partial plan will need to include the cost of theflight. So you can add together the cost of the flight with an estimate for the best costs of any additional travel, to estimate the cost of the best travel plan that includes this partial plan.

Best-first search uses this measure of the value of partial solutions to direct its search for complete solutions. The breadth-first variant of best-first search does this by picking a branch that has currently best value, and generating its successor nodes. Under some easily satisfied conditions, the first solution found in this way is guaranteed to be the best (optimal) solution.

Although such best-first search is better than simple breadth-first search, it suffers from similar disadvantages. It too is computationally explosive, espe- cially when there are many solutions that differ from one another only slightly in value. These disadvantages can be avoided to some extent by a depth-first version of best-first search, which like simple depth-first search, explores only one branch of the search space at a time.

The depth-first version of best-first search keeps a record of the best solution found so far. If the current branch is not a solution, and the branch can be extended, then it extends the branch by generating a successor node that has the highest estimated value. However, if the estimated value of the extended branch exceeds the value of the best solution found so far (if there is one), then the extended branch terminates in failure and the search strategy backtracks to an earlier alternative.

If the current branch is a new solution, then the search strategy compares its value with the value of the best solution found so far (if there is one), and it updates its record of the currently best solution. In this way, the search strategy can be terminated at any time, having generated the best solution that can be found within the computational resources available.

Both variants of best-first search complement the use of decision theory for choosing the best solution, once it has been found. The depth-first variant has the further advantage that it interprets“best solution” more realistically as “the best solution given the computational resources available”. Morever, its measure of the value of solutions and of partial solutions can be extended to include not only their utility, but also the probability of their actually achieving their expected outcomes. The resulting measure of value as expected utility, combining utility and proba- bility, integrates best-first search into a classical decision-theoretic framework.

The connection graph of an agent’s goals and beliefs can also help with best- first search, by associating with links statistical information about the degree to which the links have proved useful in the past. This information can be used to increase or decrease the strength of connections in the graph. Whenever the agent solves a new goal, it can increase the strength of links that have con- tributed to the solution, and decrease the strength of links that have led it down the garden path. The strength of links can be used for best-first search, by activating stronger links before weaker links.

The strength of links can be combined with activation levels associated with the agent’s current goals and observations. Activation levels can be spread

through the graph in proportion to the strength of links, reasoning bidirection- ally both backwards from the goals and forwards from the observations. Any candidate action subgoal whose level of activation exceeds a certain threshold can be executed automatically.

The resulting action execution combines a form of best-first search with a form of decision-theoretic choice of best action, in an algorithm that resembles a connectionist model of the brain. An agent model employing this approach has been developed by Pattie Maes (1990). The model does not use logic or connection graphs explicitly, but it can be understood in such purely logical terms. Connection graphs can also be used to combine search with compiling general-purpose goals and beliefs into more efficient special-purpose form. This is because very strong links between goals and beliefs behave as though the links were goals or beliefs in their own right. Generating these goals or beliefs explicitly and adding them to the graph short-circuits the need to activate the links explicitly in the future. For example, the fox’s specialised belief that the crow sings if I praise the crow can be generated from such more general- purpose beliefs as:

an agent does Y if I do X and the agent reacts to X by doing Y agent = the crow X = praise Y = sing the crow reacts to praise by singing

I will argue later inChapter 9that this kind of compiling links into new goals and beliefs can be viewed in some cases as a kind of compiling of conscious thought into subconscious thought.

Documento similar