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.

18 questions
8
votes
2 answers

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 material so I could focus on the search phase,…
Christian Dean
  • 738
  • 2
  • 9
6
votes
1 answer

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, evaluation(board) The problem is that it takes time…
eligolf
  • 252
  • 2
  • 10
6
votes
3 answers

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, engines would have to deal with over a billion…
4
votes
2 answers

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 this is because my alpha-beta pruning isn't…
Destaq
  • 193
  • 7
4
votes
1 answer

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 fine details in chess that are hidden from us when we…
lbragile
  • 829
  • 1
  • 8
  • 25
4
votes
4 answers

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 on the board. Let's say it's white turn, do i have…
3
votes
3 answers

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 is there any other software for Linux that can do…
dDo
  • 69
  • 2
3
votes
2 answers

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 you set a certain search depth. How do minimax with…
eligolf
  • 252
  • 2
  • 10
2
votes
1 answer

How to implement Zobrist tables?

I am making a chess engine and trying to implement Zobrist tables into my engine. From what I've read, my understanding is that you first calculate the Zobrist hashcode, then get the modulo of the hashcode divided by the size of your transposition…
wdk23
  • 80
  • 4
2
votes
1 answer

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 even tried Zobrist hashing. Why is my…
cuteboy101
  • 23
  • 2
2
votes
1 answer

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 mid game position: Depth 1: 0.01 s Depth 2: 0.07…
eligolf
  • 252
  • 2
  • 10
2
votes
1 answer

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 30 seconds to search 2 ply deep, evaluate the…
1
vote
1 answer

Can someone spot the issue with my search + evaluation?

I am working on a chess engine and believe I'm using my evaluation function in Negamax and Minimax with alpha beta pruning wrong. A couple days ago, I implemented Negamax with alpha beta pruning and noticed a large performance hit compared to the…
guest1337
  • 15
  • 3
1
vote
1 answer

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 idea at all how to do that and every time I search for…
Felipe L
  • 21
  • 1
1
vote
1 answer

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 void makeAIMove(Piece[,] board) { Move…
jack
  • 27
  • 1
1
2