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
2 answers

Trouble applying the Alpha Beta Pruning algorithm to this tree

I am trying to apply the alpha beta pruning algorithm to this given tree. I am stuck when I hit node C because after expanding all the children of B, I give A >= -4, I then expand C to get I =-3, which IS greater than -4 (-3 >= -4). Do I…
Johnathan Au
  • 5,244
  • 18
  • 70
  • 128
0
votes
1 answer

minimax code returns always 0

I wrote an Alpha-Beta pruning from Wikipedia. I am trying to write a connect-four AI. The function should return column number, then my main function makes a move.
0
votes
1 answer

Alpha-beta pruning consecutive moves for same player

I have implemented alpha-beta pruning for Checkers and thought I had it working, but found out that the computer does not take multiple jumps in a row (when it has to). For example: AI does: O _ _ _ _ _ _ _ _ _ _ X _ X _ -> _ _ _ X _ …
0
votes
2 answers

What value are alpha/beta to begin with in Minimax algorithm?

I understand the algorithm, as it applies to Alpha-Beta pruning. What I don't understand is since there is no way to represent ∞ in Java, on my first call to the Minimax method, what value should Alpha and Beta be to start out with? (Normally I…
Houdini
  • 3,442
  • 9
  • 31
  • 47
0
votes
1 answer

Is applying Minimax possible with 4 * 4 board Tic Tac Toe or need Alpha-Beta pruning?

I've implement a 3 * 3 Tic Tac Toe game in java applying Minimax algorithm only. However, when I change the board size to 4 * 4, the program seems to hang. I wanna ask whether I should apply Minimax with alpha-beta pruning to solve this problem or…
Duc Tran
  • 6,016
  • 4
  • 34
  • 42
0
votes
2 answers

Is the tree data structure needed in the alpha-beta pruning algorithm?

The alpha-beta pruning algorithm is as follows: function ALPHA-BETA-SEARCH(state) returns an action v <- MAX-VALUE(state, -∞, +∞) return the action in ACTIONS(state) with value v function MAX-VALUE(state, α, β) returns a utility value …
-1
votes
1 answer

Transposition Table Algorithm

I'm creating playing chess algorithm and i use transposition table, but searching for position that occured before takes a lot of time on deeper levels. My comparing is just creating Zobrist's hash of the position and going through my table with…
Fafkorn
  • 7
  • 2
-1
votes
1 answer

Alpha-beta pruning in Common Lisp

I tried coding Alpha-beta using the pseudocode found in Wikipedia. After the program reaches (EQ depth 0) it returns the heuristic value but depth continues deacreasing causing a cycle. Right now my code looks like this: (defun ab(tab node depth a…
-1
votes
1 answer

Alpha-beta pruning with clone doesnt work Java

Wanna simulate the next move for my AI in my othello game, but instead of just returning the next move, it makes all the moves on the original board instead of just simulating on a clone and the game ends. public class GameState implements…
NosQ
  • 11
  • 4
-1
votes
1 answer

Path of minimaxalpha beta

Well i have the pacman game with a global vector CharactersLocation with row, column of each character...( ex: character[0] is row of ghost1, character[1] is column of ghost1, character[2] the row of ghost2...and character[8] and character[9] are…
-1
votes
1 answer

TicTacToe Alpha Beta pruning RuntimeError: maximum recursion depth exceeded python with pygame

So, I'm writing a really simple TicTacToe program that uses alpha-beta pruning to search for the next move against the player but ran into a problem anytime I want to run it. I've tried anything that came to mind to solve it and even made a Java…
-1
votes
1 answer

How this evaluation function work in a Connect 4 game? (Java)

I am exploring how a Minimax algorithm can be used in a connect four game with alpha-beta pruning. So I was looking through a source code about a Connect4 player strategy and found this evaluation function: /** * Get the score of a board */ public…
steexd
  • 107
  • 1
  • 4
  • 13
-1
votes
1 answer

When is Alpha-Beta Pruning inefficient

Is there any case where we can say Alpha-Beta pruning is inefficient. In other words, let's say we have a game where you have to reach 27 to win, and you and your opponent may only use 1,2,5 each time to add up. So is Alpha-Beta pruning efficient in…
user3304841
  • 19
  • 1
  • 5
-2
votes
1 answer

How to get the size of tree in minimax Algorithm

I'm trying to get the size of tree of this code. I know Size of a tree = Size of left subtree + 1 + Size of right subtree, but I do not know how to implement with this code. I want to create a function called size after the program end I call this…
Go GO
  • 1
-2
votes
2 answers

Possible optimizations for my alpha-beta pruning algorithm?

I'm a new programmer currently coding a javascript alpha-beta pruning minimax algorithm for my chess engine, using Chess.js and Chessboard.js. I've implemented a basic algorithm with move ordering. Currently, it's evaluating around 14000 nodes for 8…
1 2 3
20
21