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

C# Tic-Tac-Toe Minimax

I am currently trying my hand at making a minimax AI for tictactoe. My goal was that it should suffice for larger boards as well. However, I am having quite a hard time wrapping my head around how to implement the algorithm. I have read countless…
Loke
  • 21
  • 2
0
votes
1 answer

AlphaBeta Multithreading in C

Currently I am developing a simple game that implements the Alpha Beta Pruning algorithm but it is quite slow when the board of the game is big. I first thought was to break the alphabeta down to 2-3 mini alphabetas to account for 2-3 different kind…
0
votes
1 answer

Alpha Beta and Minimax

I'm writing a minimax alpha beta algorithm in Java. What I did initially was create a minimax algorithm. This algorithm ALWAYS beat algorithm B, which I had also coded. Now I added Alpha beta pruning to this minimax algorithm and my algorithm always…
TheRapture87
  • 1,403
  • 3
  • 21
  • 31
0
votes
0 answers

How to get minimax algorithm to return the correct move?

I see that this has been asked before but I'm still stuck. I've used a wrapper class as suggested in another answer but the move gets over ridden every time the algorithm finds a "better" node even if it is not a move that max makes but rather min. …
0
votes
1 answer

Need help debugging alpha-beta pruning for connect four minimax code

I am writing an AI for connect-four using the minimax algorithm. In order to increase depth, I am using alpha-beta pruning. However, I am getting incorrect results with my code. I am having trouble finding out where I am going wrong. /** *…
0
votes
1 answer

c++ transposition 5x5 tictactoe error

I am programming a 5x5 tictactoe game. I get an unexpected runtime error, which returns a ROW/COL bigger than 4. Plays per player: Player: 3,3 Computer: 0,0 Player: 1,3 Computer: 0,3 Player: 3,1 Computer: 0,1 Player: 0,2 Computer: 140735274172144,…
HieiFCB
  • 11
  • 5
0
votes
1 answer

EXC_BAD_ACCESS creating child nodes (C)

I've tried applying advice from other threads regarding the EXC_BAD_ACCESS message, but with no success. The note appears next to Node Create_Child (Node Parent_Node, int item) {. typedef struct { int Win_Loss; int parent; int…
surf-n-cherf
  • 63
  • 1
  • 7
0
votes
1 answer

Minimax with alpha-beta pruning problems

I'm making a C++ program for the game chopsticks. It's a really simple game with only 625 total game states (and it's even lower if you account for symmetry and unreachable states). I have read up minimax and alpha-beta algorithms, mostly for tic…
0
votes
0 answers

Alpha Beta Pruning Breaking Minimax

So I implemented a minimax search for my chess based puzzle game. In this case the search determines the AI pieces next move. The minimax on it's own works fine it returns the expected move but when I implement alpha beta pruning the minimax…
0
votes
1 answer

Understanding the Minimax Algorithm

I am trying to create an AI opponent for a two player 8x8 board game. After a research I found Minimax algorithm handy enough to do the job. The AI opponent I am creating will play against an other AI opponent or Human. I have a doubt in…
0
votes
2 answers

Wagon Robbery (C Language)

Good evening. Apologies if the question is poorly formated as it's my first time posting here. I'm looking for aid with a particular exercise, as I've brainstormed for almost two hours now and can't find any suitable solution. The exercise is as…
0
votes
1 answer

Alpha-beta pruning - how this code implement resetting variables alpha and beta?

Hello, I'm trying to understand the alpha beta pruning algorithm using chess as an example from the following code: def minimax(position, depth): """Returns a tuple (score, bestmove) for the position at the given depth""" if depth == 0 or…
Vincent
  • 273
  • 1
  • 2
  • 9
0
votes
0 answers

Connect 4 Minimax AI not working correctly

I have recently tried to implement the minimax algorithm for connect 4 to create a bot for it, to keep it simple (possibly complicating things) I used Python. Here is what I have so far: # Connect 4 Bot # Author: Angus Moore…
ToXic73
  • 332
  • 6
  • 15
0
votes
1 answer

How to build a Game Tree using alpha-beta pruning

Im trying to build a game tree to my game in order to find my next move. At first, Im building the tree using a recursive algorithm, and then, to find the best move Im using the alpha - beta pruning algorithm. I want to build the game tree using the…
Golan Kiviti
  • 3,895
  • 7
  • 38
  • 63
0
votes
1 answer

How to use the alphabeta pruning for connect four like game

Could someone be so kind to help me understand how to use the alpha-beta pruning algorithm? I'm making a game similar to connect four. The only differences is there is no diagonal win, and a player can mark an square at any given time (unless it is…
Dave Smith
  • 177
  • 1
  • 3
  • 11