Questions tagged [minimax]

Minimax is a kind of backtracking algorithm that is used in decision making and game theory to find the optimal move for a player, assuming that your opponent also plays optimally. It is widely used in two player turn-based games such as Tic-Tac-Toe, Backgammon, Mancala, Chess, etc.

Filter by
Sorted by
Tagged with
1 vote
1 answer
653 views

How do I implement UCI in my Python chess engine?

I have developed a chess engine in Python with negamax, alpha beta and piece square table. I want to "compile" my code into a UCI compatible one so I can load it to Arena GUI, but I have no ...
2 votes
1 answer
361 views

My Transposition Tables implementation slows down Alpha Beta Pruning

I have this implementation of alpha beta pruning I made a couple days ago. I've been trying to look into transposition tables. When I tried this implementation it was slower than the original code. I ...
1 vote
1 answer
498 views

Why is my chess engine that uses minimax with alpha-beta pruning so slow, even at depth 3?

I have little experience with any sort of chess AI and am at a complete loss as to why it still takes a couple of seconds to calculate a decent move even at just depth 3. Here is the code: private ...
1 vote
0 answers
237 views

Why is futility pruning causing an Elo drop in my engine?

I'm getting weird results when introducing futility pruning into Blunder. On the one hand, I'm getting a pretty sizeable reduction in nodes, and I'm searching a full ply deeper for some positions (e.g....
8 votes
2 answers
2k views

Is it normal for a chess engine to blunder material if its evaluation is only based on naive material evaluation?

For the past couple of weeks, I've been making a chess engine, and right now I'm working on creating its search and evaluation phases. To start off with, I made the evaluation phase a simple count of ...
1 vote
1 answer
190 views

How to avoid the same opening move in an engine built using Python chess

I created a chess engine using the Python chess library. It has an evaluation function (piece values, piece square values, and capture values) and minimax. Alpha-beta pruning is also implemented. At ...
1 vote
0 answers
292 views

Relation between Elo and search depth for basic minimax

If we use the most basic approach to a chess engine (for example, for a codegolf): minimax to a fixed depth with the material count as static evaluation, then how strong is this algorithm? This of ...
4 votes
2 answers
1k views

How can I increase the search ply depth of my minimax function for my chess engine?

I have programmed a minimax function with alpha-beta pruning for a chess engine I am building. However, it is very slow and I cannot analyze to a deeper depth as it would take too much time. I believe ...
2 votes
1 answer
477 views

The most efficient valid move generation for minimax

Problem I am creating a chess engine in Python using Minimax algorithm (with alpha/beta pruning) but I have some issues with performance. Currently the thinking time looks something like this for a ...
3 votes
3 answers
895 views

Chess Position Trainer on Linux or Minimax on Linux

Chess Position Trainer allows you to do leaf node evaluation and then minimax the results after that. Is it possible to install Chess Position Trainer on Linux? (I tried under mine, but couldn't), or ...
5 votes
1 answer
480 views

Minimax check(mate) detection

in my minimax function I have a first few lines looking something like this: children = board.get_all_possible_moves(board) if depth = 0 or board.is_check_mate or board.is_draw: return None, ...
3 votes
2 answers
3k views

Minimax with alpha-beta pruning for chess

I am creating a chess AI using the minimax method with alpha-beta pruning. I am trying to understand how the alpha-beta pruning works, but I can't get my head around it when it comes to chess where ...
6 votes
3 answers
2k views

How can minimax chess engines do alpha-beta pruning without reaching the final positions?

In order to calculate far ahead, minimax chess engines must perform alpha-beta pruning, where they don't calculate positions that are obviously winning or obviously losing. Without doing pruning, ...
2 votes
1 answer
880 views

Speed of minimax with alpha beta pruning in chess engines

Can a minimax function with just alpha beta pruning really evaluate 1.8 billion chess positions (3 ply = 356) in just a second? My chess engine, which uses minimax with only alpha beta pruning, takes ...
4 votes
4 answers
570 views

Minimax and alpha beta

I want to implement a simple chess bot so I have been reading about this algorithm a lot. I can say I understand the basic idea of the algorithm but I can't clearly see how am I supposed to apply it ...
4 votes
1 answer
390 views

Minimax algorithm - Play with Black pieces?

Motivation: I am trying to make a basic AI agent that can play chess against an opponent. The goal is to see how good it can become through the use of machine learning later on and also learn the ...