Heuristic Search

4.3 Heuristic Search

Heuristic search methods can be used if we are able to define a heuristic function that estimates “how far” a search tree node is from a solution. This allows us to expand those paths that seem to be the most promising. Let us assume that in our labyrinth,

13 The constant c is a parameter of the method. 14 Edsger W. Dijkstra—a professor of computer science at the Eindhoven University of Technology.

His contribution to computer science includes Reverse Polish Notation, the ALGOL compiler, structured programming, and a semaphore model used in operating systems.

15 In the case of the labyrinth the cost could be defined as the difficulty of going along a segment of the path. The difficulty could be defined as the width of the path (let us assume we are rather fat)

and the slope of the path (let us assume we are not fit). 16 In the case of Uniform Cost Search the order in which new states are generated is not accidental in

sensu stricto. The method is not “blind” completely, because the order in which states are generated is determined by the cost function. However, this function does not say what the distance to a solution state is. Therefore, this method is not considered a heuristic method.

4.3 Heuristic Search 39 Fig. 4.5 The labyrinth

problem: a values of the

A heuristic function, b the

(a)

4 5 heuristic search

(b)

the nearer the exit we are, the more the flame of our candle flickers. Then, we can define the heuristic function h in the following way: h(n) = 5—the flame is stable, h(n) = 4—the flame is flickering a little bit, h(n) = 3—the flame is flickering, h(n) = 2—a high frequency flicker in the flame is observed, h(n) = 1—a very high frequency flicker in the flame is observed, h(n) = 0—the candle has been blown out (we are at the exit).

The labyrinth plan, which contains values of the function h, from the “perspective of Providence”, is shown in Fig. 4.5 a. As we have mentioned, we do not have such a plan, so we have to look for the exit. However, in this case, contrary to a blind search, we can choose the path with the help of the heuristic function, i.e., observing a flame

40 4 Search Methods of the candle. Similarly to the case of blind methods, there are a lot of strategies

using a heuristic search. Hill climbing is a simple modification of DFS which consists of expanding nodes that are the best in the sense of the heuristic function. 17 If values of the heuristic function for our labyrinth are defined as shown in Fig. 4.5 a, then the tree is expanded in the way depicted in Fig. 4.5 b. Let us notice that we find a solution node in four steps, whereas using DFS we need ten steps (cf. Fig. 4.4 ), and for BFS we need even more steps (cf. Fig. 4.3 b). Hill climbing is a local search method, i.e., we can go only to neighboring states from the present state. Sometimes, the value of the heuristic function for a node after expanding the path is worse than a value for some node generated in the past. This means that we have expanded a path that seemed to be promising at first, however we see now that the values of the heuristic function are worsening. In such a situation, we should look for such a node expanded before now, which has the best value among such nodes and we should begin expanding other paths starting from this node. This strategy, defined by Judea Pearl [221], is called Best-First Search.

The methods described in this section use a heuristic function that estimates how far nodes are from a solution. The choice of succeeding node is made on the basis of this criterion only, neglecting the cost of moving from the present node to the successor. On the other hand, it seems that taking this cost into consideration is a reasonable strategy. (We have used such a cost in Uniform Cost Search, introduced in the previous section.) In 1968 Peter E. Hart, Nils J. Nilsson and Bertram Raphael proposed the A ∗ algorithm [126]. It uses both criteria for choosing the optimum node. These criteria are elements of the evaluation function f , given by the formula

(4.1) where g(n) is the cost of the path from the root node to a node n, and h(n) estimates

f (n) = g(n) + h(n),

how far a node n is from a solution. Heuristic methods introduced above apply a strategy of expanding a path deep into the search space. Beam Search, introduced by Bruce T. Lowerre and Raj Reddy [187], is based on expanding a path breadth-wise. Similarly to BFS, we generate nodes one level after another. However, we expand only the b (b is a parameter of the method) best nodes at each level.

At the end of this section, we introduce some properties which are required for

a heuristic function. We say the heuristic function h is admissible if the distance to a solution is never overestimated by h. For example, if finding the smallest road distance between cities is our problem, then a heuristic function, which gives a straight-line distance between cities is admissible, because it never overestimates the actual distance. This property is very important because a heuristic function,

17 A good example of hill climbing is a situation when we want to reach the top of a mountain. However, we have neither a map nor a compass, we are here at night, and a dense fog hangs over

the mountains. We have only an altimeter. So, according to the idea of hill climbing, we should go in the direction for which the altimeter shows the biggest increase in height.

4.3 Heuristic Search 41 which overestimates the actual distance can make finding the best path to a goal

node impossible. On the other hand the heuristic function h can underestimate the distance a little bit, i.e., its evaluation should be moderately “optimistic”. At the same time, we require the function “optimism” should be more and more realistic as we approach

a solution. This means that h should estimate more and more precisely. At least we require that the cost of making each succeeding step is compensated by increasing the precision of the evaluation of the remaining distance. If the heuristic function has this property, then we call it consistent (monotone).

Let h 1 and h 2 be heuristic functions. If for any state v we have h 2 (v) ≥ h 1 (v) , then the function h 2 dominates the function h 1 . Let us notice that if both functions

h 1 and h 2 are admissible, then they are bounded by the actual distance to a goal. This means that for any state v, h 1 (v) ≤ C(v) and h 2 (v) ≤ C(v) , where C(v) is the actual distance to a goal state. Thus, a dominating function estimates the distance better. (It is closer to C(v).) Therefore, in the case of admissible heuristic functions it is better to use a dominating function.

At the end of this section, let us mention that the properties of heuristic functions introduced above are defined formally in Appendix A.

Dokumen yang terkait

Hubungan pH dan Viskositas Saliva terhadap Indeks DMF-T pada Siswa-siswi Sekolah Dasar Baletbaru I dan Baletbaru II Sukowono Jember (Relationship between Salivary pH and Viscosity to DMF-T Index of Pupils in Baletbaru I and Baletbaru II Elementary School)

0 46 5

Institutional Change and its Effect to Performance of Water Usage Assocition in Irrigation Water Managements

0 21 7

The Effectiveness of Computer-Assisted Language Learning in Teaching Past Tense to the Tenth Grade Students of SMAN 5 Tangerang Selatan

4 116 138

the Effectiveness of songs to increase students' vocabuloary at second grade students' of SMP Al Huda JAkarta

3 29 100

The effectiveness of classroom debate to improve students' speaking skilll (a quasi-experimental study at the elevent year student of SMAN 3 south Tangerang)

1 33 122

Kerjasama ASEAN-China melalui ASEAN-China cooperative response to dangerous drugs (ACCORD) dalam menanggulangi perdagangan di Segitiga Emas

2 36 164

The Effect of 95% Ethanol Extract of Javanese Long Pepper (Piper retrofractum Vahl.) to Total Cholesterol and Triglyceride Levels in Male Sprague Dawley Rats (Rattus novergicus) Administrated by High Fat Diet

2 21 50

Factors Related to Somatosensory Amplification of Patients with Epigas- tric Pain

0 0 15

The Concept and Value of the Teaching of Karma Yoga According to the Bhagavadgita Book

0 0 9

Pemanfaatan Permainan Tradisional sebagai Media Pembelajaran Anak Usia Dini untuk Mengembangkan Aspek Moral dan Bahasa Anak Utilization of Traditional Games as Media Learning Early Childhood to Develop Aspects of Moral and Language Children Irfan Haris

0 0 11