Adversarial Search

4.4 Adversarial Search

Search methods can be used for constructing artificial intelligence systems which play games. Such systems are one of the most spectacular computer applications. 18 Search techniques used for game playing belong to a group of AI methods called

adversarial search . In Sect. 2.1 we have introduced search methods with the example of a chess game. Let us recall that states in a state space correspond to succeeding board positions resulting from the players’ moves.

In the case of games we construct an evaluation function, 19 which ascribes a value saying how “good” for us is a given situation, i.e., a given state. Given the evaluation function, we can define a game tree, which differs from a search tree introduced in

previous sections. 20 The minimax method is the basic strategy used for adversarial search. Let us assume that maximizing the evaluation function is our goal, whereas our opponent (adversary) wants to minimize it. 21 Thus, contrary to the search trees

18 In May 1997 Deep Blue, constructed by IBM scientists under the supervision of Feng-hsiung Hsu, won a chess match against the world champion Garry Kasparov.

19 The evaluation function estimates the expected utility of a game, defined by the utility func- tion . This function is a basic notion of game theory formulated by John von Neumann and Oskar

Morgenstern in 1944. 20 In the case of game trees we use a specific terminology. A level is called a ply. Plies are indexed

started with 1 (not 0, as in common search trees). 21 Hence, a mini-max method.

42 4 Search Methods

(a)

(b) MAX

MIN

MAX 4 6 5 2 9 8 9 7 2

(c)

Fig. 4.6 Succeeding steps of a search tree evaluation in the minimax strategy

introduced in the previous sections, which are defined to minimize the (heuristic) function corresponding to the distance to a solution, in the case of a game tree we alternately maximize the function (for our moves) and minimize it (for moves of our opponent).

Let us look at Fig. 4.6 a. The tree root corresponds to a state where we should make

a move. Values are ascribed to leaf nodes. (It is also our turn to move at leaf nodes; it is the opponent’s turn to move at nodes in the middle ply, denoted by MIN.) Now, we should propagate values of the evaluation function upwards. 22 Having values of leaves of the left subtree: 4, 6, 5, we propagate upwards 4, because our opponent will make a move to the smallest value for us. (He/she minimizes the evaluation function.)

22 An arrow up means that we ascribe to a node the biggest value of its successors, an arrow down means we ascribe to a node the smallest value of its successors.

4.4 Adversarial Search 43

4 6 5 2 9 7 2 Fig. 4.7 Succeeding steps of a search tree evaluation in the α-β pruning method

The opponent will behave analogously in the middle subtree (cf. Fig. 4.6 b). Having the choice of the leaves 2, 9, and 8, he will choose the “worst" path, i.e., the move to the node with the value 2. Therefore, this value is propagated upwards to the parent of these leaf nodes. After determining the values at the middle MIN ply, we should evaluate the root (which is placed at a MAX ply). Having values at the MIN ply of

4, 2, 2, we should choose the “best"path, i.e., the move to the node with the value 4.

Thus, this value is ascribed to the root (cf. Fig. 4.6 c).

Let us notice that such a definition of the game tree takes the opponent’s behavior into account. Starting from the root, we should not go to the middle subtree or the right subtree (roots of these subtrees have the value 2), in spite of the presence of nodes having big values (9, 8, 7) in these subtrees. If we went to these subtrees, the opponent would not choose these nodes, but nodes having the value 2. Therefore, we should move to the left subtree. Then, the opponent will have the choice of nodes with the values 4, 6, and 5. He/she will choose the node with the value 4, which is better for us than a node with the value 2.

In case a game is complex, the minimax method is inefficient, because it generates huge game trees. The alpha-beta pruning method is a modification of minimax that decreases the number of nodes considerably. The method has been used by Arthur L. Samuel in his Samuel Checkers-playing Program. 23

We explain the method with the help of an example shown in Fig. 4.7 . Let us assume that we evaluate successors of the root. After evaluating the left subtree, its root has obtained the value α = 4. α denotes the minimum score that the maximizing player is assured of. Now, we begin an evaluation of the middle subtree. Its first leaf has obtained the value 2, so temporarily its predecessor also receives this value. Let us notice that if any leaf, denoted by X, has a value greater than 2, then the value of its predecessor is still equal to 2 (we minimize). On the other hand, if the value of any leaf X is less than 2, then it does not make any difference for our evaluation, because 2 is less than α —the value of the neighbor of the predecessor. (This means that this neighbor, having the value α = 4, will be taken into account at the level

23 Research into a program that plays checkers (English draughts) was continued by a team led by Jonathan Schaeffer . It has resulted in the construction of the program Chinook. In 2007 Schaeffer’s

team published an article in Science including a proof that the best result which can be obtained playing against Chinook is a draw.

44 4 Search Methods of the root of the whole tree, since at the ply of the root we maximize.) Thus, there

is no need to analyze leaves X (and anything that is below them). 24 A parameter β plays the symmetrical role, since it denotes the maximum score that the minimizing player is assured of.

The alpha-beta pruning method allows one to give up on a tree analysis, in case it does not influence a possible move. Moreover, such pruning does not influence the result of a tree search. It allows us to focus on a search of the promising parts of a tree. As a result, it improves the efficiency of the method considerably. 25

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