Questions tagged [alpha-beta-pruning]

A search algorithm that seeks to decrease the number of nodes, which are evaluated by the minimax algorithm, in its search tree

For more info see the Alpha-beta pruning wikipedia article.

304 questions
0
votes
0 answers

Transposition table based cutoff: Why not use betaOrig

In this wiki entry following implementation is given function negamax(node, depth, α, β, color) is alphaOrig := α (* Transposition Table Lookup; node is the lookup key for ttEntry *) ttEntry := transpositionTableLookup(node) if…
Ris
  • 165
  • 10
0
votes
1 answer

What is wrong with my transition table in my negamax implementation?

I'm writing a Chess AI in TypeScript which uses negamax with alpha beta pruning to search through possible moves. It uses two heuristics: 1) the main heuristic, which evaluates leaf nodes in the negamax tree traversal, and 2) a simple inexpensive…
byte-this
  • 204
  • 1
  • 2
0
votes
0 answers

Minimax algorithm for tic tac toe doesnt give optimal solution

I am writing 3D tic tac toe game using minimax algorithm with alpha beta pruning, but the algorithm doesnt give optimal solution, it goes and chooses next possible solution from winning states, not taking into concern what is on the board, meaning…
0
votes
0 answers

Heuristic function for Pylos game

Pylos is a game constituted of a 4x4 pyramid board (4x4 below a 3x3 below a 2x2 below a 1). There are two players, one with White marbles and the other with Black marbles. Each player has 15 marbles initially and takes turns placing a marble on the…
0
votes
0 answers

How to increase performance of Alpha-Beta-Pruning without increasing tree depth?

am programming an Nine-Mens-Morris game in WPF and it is almost finished. I want to make it harder to beat the AI, but I dont know how. Is there a way to improve without increasing tree depth? I don't want to increase the "thinking Time" Here is the…
0
votes
1 answer

I'm getting an error in the loop on line 36 and 68, and I don't know why

I'm making a chess engine using alpha-beta pruning for a project, and here is my code. I'm getting an error on line 36 and 68,and I'm not sure how or why. Please help me. Thank you for your answers in advance. import chess def evaluate() : if…
Yash
  • 1
0
votes
0 answers

how to convert a minimax to an alpha beta pruning in prolog

there is a 4 connect game using a minimax algorithm I'm trying to improving it by turning it to alpha-beta i have this : getResult([H,T|_],H,T). doBest(Color, Depth, BestScore, BestMove):- board(C,_), setof(X,between(1,C,X),MoveList), …
0
votes
1 answer

Minimax algorithm still does play optimal moves in a tic-tac-toe game

I implemented minimax with alpha-beta pruning for a tic-tac-toe game. This is the code: This function returns if there are any more moves left. bool isMovesLeft() { for (int x = 0; x < ROWS; x++) for (int y = 0; y < COLS; y++) …
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263
0
votes
1 answer

chess - Is it possible to collect pv moves ending with checkmate, using triangular tables?

I'm trying to figure out how a traditional chess engine (no AI) works, and now I'm trying to collect pv (principal variation) moves using triangular table. So I'm using a NxN table and a very simple implementation private Integer alphaBeta(final int…
dakat
  • 51
  • 6
0
votes
1 answer

Alpha-beta pruning with a silly move

After learning about alpha-beta pruning algorithm for a while, I decided to write a simple chess program. However, when running the program, the computer decides to make a silly move. I don't know where the functions are written wrong. What do I…
0
votes
0 answers

what's the difference between different ways of iterate through a list

I am currently taking cs188 courses offered by UCB. I encountered the problem when implementing the alpha-beta pruning algorithm. Two different ways of implementation is showed below. # this one works def max_value(self, gamestate, depth,…
0
votes
1 answer

Is there a way to optimise the minimax algorithm further after alpha-beta pruning

I've just finished coding the connect 4 game on python and added the minimax algorithm to it but (I might be exaggerating only a bit) it took a million years. So, I added Alpha-Beta pruning to it. However, it is still loading and looking for the…
0
votes
0 answers

Transposition table look up for Fail-hard vs Fail-soft Alpha-beta, how do they differ?

I am new to chess-programming (and I actually make engine to some variant of draughts) and currently I'm trying to understand transposition tables. I have seen many examples of transposition table look up implementations that differ in detail. I…
0
votes
0 answers

Minimax (with alpha beta pruning): when to store the solution?

I have implemented a version of the minimax algorithm with alpha/beta pruning, for a connect four game. When using minimax, I would like to save the best AI column to play for in a dictionary called solution (so that, I can also save other…
Carmellose
  • 4,815
  • 10
  • 38
  • 56
0
votes
1 answer

How to solve a game with repeating positions (Teeko)

I have been trying to find a algorithm to strongly solve the game Teeko. The game is played on a 5x5 board were each player has 4 pieces and attempts align them in any direction or create a square out of them. (assume there is no drop phase) I have…