06.03.2013 Views

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

Artificial Intelligence and Soft Computing: Behavioral ... - Arteimi.info

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

(iv) If all of the nodes connected to CURRENT through the new<br />

marked arcs have been labeled SOLVED, Then mark the<br />

CURRENT SOLVED.<br />

(v) If CURRENT is marked SOLVED or the cost of CURRENT<br />

was changed, Then propagate its new status back up the tree,<br />

add all the ancestors of CURRENT to S.<br />

Until S is empty.<br />

Until INIT is labeled solved or its h’ value becomes greater than a maximum<br />

level called FUTILITY:<br />

End.<br />

4.4 Adversary Search<br />

In this section we will discuss special type of search techniques required in a<br />

game playing between two opponent players. The state space in this case is<br />

represented by a tree or graph <strong>and</strong> includes the possible turns of both players.<br />

Each level of the search space in the present context denotes the possible turn<br />

of one player only. We start with a simple algorithm called MINMAX <strong>and</strong><br />

gradually develop more complex algorithms for game playing.<br />

4.4.1 The MINIMAX Algorithm<br />

The MINIMAX algorithm considers the exhaustive possibility of the state<br />

transitions from a given state <strong>and</strong> consequently covers the entire space. The<br />

algorithm, thus, is applicable to games having few possible state transitions<br />

from a given trial state. One typical example that can be simulated with<br />

MINIMAX is the NIM game. A NIM game is played between two players.<br />

The game starts with an odd number of match sticks, normally 7 or 9, placed<br />

on a single row, called a pile. Each player in his turn has to break a single<br />

pile into two piles of unequal sticks, greater than zero. The game will come<br />

to an end when either of the two players cannot give a successful move. The<br />

player who cannot give a successful move the first time will lose the game.<br />

According to st<strong>and</strong>ard convention we name the two players MINIMIZER<br />

<strong>and</strong> MAXIMIZER. NIM is a defensive game <strong>and</strong> consequently the opening<br />

player, here, is called the MINIMIZER. For a game such as tic-tac-toe, where<br />

the opener always gets the benefit, the opening player is called the<br />

MAXIMIZER. A graph space for the NIM game is presented in fig. 4.12 (a),<br />

demarcating MAXIMIZER’s move from the MINIMIZER’s move.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!