# ALGORITMA MINIMAX PDF

Loncat ke navigasi Loncat ke pencarian Artikel bertopik teknologi informasi ini perlu dirapikan agar memenuhi standar Wikipedia Merapikan artikel bisa berupa membagi artikel ke dalam paragraf atau wikifikasi artikel. Setelah dirapikan, tolong hapus pesan ini. Algoritme minimax merupakan basis dari semua permainan berbasis AI seperti permainan catur misalnya. AI permainan catur tentunya sudah sangat terkenal dimana AI tersebut bahkan dapat mengalahkan juara dunia sekalipun. Pada algoritme minimax, pengecekan akan seluruh kemungkinan yang ada sampai akhir permainan dilakukan.

 Author: Zuluk Zulkizshura Country: Ecuador Language: English (Spanish) Genre: Science Published (Last): 7 October 2008 Pages: 106 PDF File Size: 19.54 Mb ePub File Size: 11.53 Mb ISBN: 131-9-13234-686-7 Downloads: 35144 Price: Free* [*Free Regsitration Required] Uploader: Zulugrel

Vamsi Sangam Hello people! In this post we will look at one of the most basic Artificial Intelligence algorithm, the MiniMax algorithm. MiniMax algorithm is used to implement basic AI or game logic in 2 player games. The most common scenario is implementing a perfect Tic-Tac-Toe player.

So, in this article we will look at how to implement it. Definition — Given that two players are playing a game optimally playing to win , MiniMax algorithm tells you what is the best move that a player should pick at any state of the game. So, the input to MiniMax algorithm would be — State of the game. Whose turn it is. And the output would be the best move that can be played by the player given in the input.

If O wins, the score is decreased by If it is a draw, then the score remains unchanged. So now, the bigger the number score has, the better it is for X, which means X will try to maximize score as much as possible. Similarly, the lesser the score, the better it is for O, so O will try to minimize the score as much as possible. To understand this better, imagine you are player X and this is the current state of your game — So if you are in state 1 from the above diagram , you have 3 possible moves which lead to state 2, 3 and 4.

So conceptually we know that player X must choose the winning move. This is done programmatically bu choosing the move which will return the maximum score. So, X will always try to maximize the score and will always choose that move which will fetch X the maximum score. Thus, in the above scenario X chooses the move which goes to state 2. Now, to make sure you understand both sides of this algorithm. Can you draw a state diagram which will depict all the possible moves and the scores which will be returned by playing them?

You can! You should get a diagram like this — Did you get a diagram like this? Player O has 3 possible moves and the scores are — if you choose to go to state 2.

Player O will always try to minimize the score, so player O must select a move which will either lead to state 2 or 3 to win. Firstly, have a clarity on the smaller pieces of logic and write methods for them first.

You will need these 3 helper methods for your code — printGame game — which prints the state of Tic-Tac-Toe game. So now you have a little clarity over the smaller pieces, code them first. Now, you are ready to write the MiniMax algorithm method.

We can make a new class to return all the information we need. When in doubt come back and read the MiniMax algorithm theory and the implementation tips. Remember, you are trying to write the code for an ideal Tic-Tac-Toe player here, so you need to write the starter code for simulating a 2-player Tic-Tac-Toe game.

Take the case given below — So for the above case, player O will lose no matter the decision taken. If you think about this, if we apply the Minimax algorithm we formed so far, in this case Player O would choose state 2.

This is because state 2 is the first state it programmatically encounters while computing the minimum value. How do we implement this in our algorithm? So, if a player wins by taking more turns, the gain would be lesser and if the player took lesser turns, the gain would be more. Now our TicTacToe bot is an ideal bot!

If you get stuck, you can refer to my code — Link to code — GitHub Congrats on taking your first step to build your dream AI! Happy Coding!

ARTROPLASTIA UNICOMPARTIMENTAL DE RODILLA PDF

## Pengertian Algoritma Minimax

Algoritma Minimax akan selalu mengecek semua kemungkinan yang ada sampai akhir permainan itu dilakukan, kemudian pengecekan tersebut akan menghasilkan pohon permainan yang berisi semua kemungkinan-kemungkinan tersebut. Pada permainan yang berbasis Minimax seperti catur, tentunya dibutuhkan resource yang sangat besar untuk memproses pencarian pohon permainan tersebut, karena kombinasi kemungkinan untuk permainan catur pada setiap gerakannya banyak sekali. Algoritma Minimax bekerja secara rekursif dan mampu menganalisis segala kemungkinan pada permainan yang dimanfaatkan untuk menghasilkan keputusan terbaik, sehingga dapat membuat lawan mengalami kerugian Minimum. Semua strategi lawan akan dihitung dengan algoritma yang sama terus-menerus. Pada langkah pertama komputer akan menganalisis seluruh pohon permainan, kemudian untuk setiap langkahnya, komputer akan memilih langkah yang akan membuat lawan mendapatkan kerugian Minimum dan membuat komputer itu sendiri mendapatkan keuntungan Maksimum. Dalam rangka untuk menentukan keputusan terbaik tersebut, dibutuhkan suatu nilai yang merepresentasikan kerugian atau keuntungan yang akan diperoleh jika langkah tersebut dipilih.

AKTIVITETSRAPPORT BLANKETT PDF

## IMPLEMENTASI ALGORITMA MINIMAX PADA PERMAINAN CATUR

Dari beberapa kelamahan itu munculah sebuah alat bantu kerja yang cepat dan akurat yaitu komputer. Semakin berkembangnya jaman, komputer bukan hanya dapat bertindak saja tapi juga dapat berfikir, dari situlah muncul istilah Artificial Intellegence AI atau Kecerdasan Buatan. Salah satu contoh dari Kecerdasan Buatan adalah minimax, minimax adalah salah satu algoritma yang menggunakan teknik pencarian secara Depth-First Search DFS. Salah satu media yang cocok dalam penggunaan teknik minimax ini adalah sebuah permainan sederhana yaitu Catur, beberapa alasan mengapa catur dapat menjadi media penerapan kecerdasan buatan antara lain catur sangat mungkin untuk dibandingkan dengan kemampuan manusia, mudah dimainkan dan dapat menentukan ukuran kesuksesan atau kegagalan. Pendahuluan 1. Kemudian muncul sebuah ide untuk menciptakan komputer cerdas yang dapat berfikir.

MIA COUTO TERRA SONAMBULA PDF