• No se han encontrado resultados

Venta del producto

Distribucion del Aceite de Oliva segn su uso

9. Barreras de entrada al mercado

9.3. Venta del producto

The search methods discussed so far all perform blind search, because none of these methods would evaluate the "goodness" of a state to be explored. In order to make search more effective and more efficient, it would be beneficial to develop some criteria to evaluate the "goodness" of each state. This is where heuristic search comes from. In the following, we first provide a discussion on heuristics, then we will discuss search methods using heuristics. 2.8.2.1 Heuristics

A heuristic is a rule of thumb which can be used to help us to solve the problem. For example, if you are looking for your friend, and if you see his car in front of the library, you may expect to find him in the library. However, heuristics are fallible, because they do not guarantee a solution (or a good solution) will be found. In our current example, the heuristic rule you used ("if somebody's car is there, then that person must be close by") is fallible because you do not know your friend's car is broken, and his roommate has given him a ride home. Nevertheless, in many situations, heuristics are useful.

Heuristics have been extensively studied by computational intelligence researchers. As for the nature of heuristics, Lenat (based on his AM and EURISKO programs) claimed that " (h)euristics are compiled hindsight, and draw their power from the various kinds of regularity and continuity in the world; they arise through specialization, generalization, and--surprisingly often--analogy" [Lenat 1982]. Some other researchers noted that "(t)he history of artificial intelligence shows us that heuristics are difficult to delineate in a clear-cut manner and that the convergence of ideas about their nature is very slow" [Groner, Groner and Bischof 1983]. A comprehensive discussion on heuristics in computational intelligence can be found in [Pearl 1984]. Heuristics have also been studied in knowledge-based systems, particularly in knowledge acquisition.

It is important to understand what heuristics are: they are rules of thumb (rather than mandatory rules) because although they are useful, they are also fallible. Heuristics are useful in problem solving and can be incorporated into algorithms. However, heuristics themselves are not algorithms nor solutions. Rather, they serve as a smart guide for problem solving. There are pros and cons of using heuristics: they can help to identify better (more promising) states and find shorter paths (optimal or suboptimal solutions). However, we should also remember that heuristics themselves become a kind of overhead and there is a need to limit the amount of time spent computing the heuristic values used in selecting a node for expansion. For example, many mutual funds allow investors to purchase shares through automatic investment plans, with the advantage to the investor of dollar cost averaging. Many of the funds also allow investors to pick a specific date in the month for money transfer from the bank. So how to select the best date for largest gain? The heuristic is "buying on the next-to-last market day of the month." The reason is that the market generally performs better-than-average late in the month and early in

33

the month, so this timing puts your money into funds just before the bullish period (Mutual Fund Magazine, May 1999, p. 33). Note heuristics need to be measured to reflect their effect. In this mutual fund example, the heuristics used can be measured by its impact on the rate of return.

As a more concrete example, we can talk about heuristic functions for the 8-puzzle problem. One heuristic is tiles out of place. We can simply count how many tiles are out of place when it is compared with the goal and take the sum. In Figure 2.11(a), such tile is marked by an asterisk (*). The total number of tiles out of place is 5. Do this to all states that need to be evaluated. The state with the smallest sum will be selected.

State to be evaluated: Goal state:

2 * 8 * 3 1 2 3

1 * 6* 48 4

0 7 5 7 6 5

Figure 2.11 (a) An example

Another heuristic is sum of distances out of place: Unlike the previous heuristic which only considers how many tiles are out of places, we now count how far away for each tile. For example, in the state shown in the left of Figure 2.11 (b), the tile numbered 8 need at least two steps to get to the position it should be. Note that in reality, to make 8 to arrive at its destination may require mor e step s than 2 steps. As we will soo n see, this is a v ery im portan t property of heuristics. The least number of steps needed to reach the goal position is shown in parentheses in corresponding cells. The sum of all tiles is 1 (for tile 2) + 2 (for tile 8) + 1 (for tile 1) + 1 (for tile 6) + 1 (for tile 7) = 5. This sum is then compared with all the other sums of competing states.

2 (1) 8 (2) 3 (0) 1 2 3

1 (1) 6 (1) 4 (0) 8 4

0 7 (1) 5 (0) 7 6 5

Figure 2.11 (b)

2.8.2.2 Best first search

As an example of best first search, let us consider hill climbing. It is a heuristic problem-solving method that works by choosing a value for each variable and iteratively improving its assignment. It requires a heuristic value for each total assignment. Hill climbing can be viewed as a graph-searching procedure where a node in a graph corresponds to an assignment of a value to each var iable as a n od e. Th e n eigh bo r s of a no de co rr esp on ds to an assignment of a value to each variable as a node. The neighbors of a node correspond to the assignments that are close to the assignment represented by the node. Initially a single node is selected to start. Maintaining a single node at each

state, the algorithm selects the neighbor of the node with the highest heuristic value, and use that as the next node to search from. The algorithm stops when no neighbor has a higher value than the current node. A general description of the best first search algorithm is shown below.

Best first search algorithm

_______________________________________________________________ open = [start];

closed = []; while open <> []

{remove the state with the highest priority, denote it as d; if d = goal then return the path from start to d;

else

{generate children of d; for each child of d do

{if the child is not found in open or closed {assign the child a heuristic value; add the child to open};

if the child is found in open

{if the child was reached by a shorter path this time re-assign the child a heuristic value using shorter path} if the child is found in closed

{if the child was reached by a shorter path this time remove the state from closed;

add the child to open} move the state to closed;

determine the state with the highest priority to be examined next;} return failure (open is empty)}

_______________________________________________________________ A specific version of this algorithm is generally referred to the A* algorithm (pronounced as A-Star algorithm). This algorithm requires the evaluation function must take a specific form. The A* algorithm is listed below.

A* algorithm

______________________________________________________________

Documento similar