Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 977027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:50:19+00:00 2026-05-16T03:50:19+00:00

I have experienced AlphaBeta algorithm with my own old chess engine and now i

  • 0

I have experienced AlphaBeta algorithm with my own old chess engine and now i am trying to write new engine and i see that algorithim encounter beta cut-offs but in my opinion, this should never be occur if i don’t use narrowed window. Am i wrong ? I am using int.MaxValue for beta and -int.MaxValue for alpha so what can cause a beta cut-offs ?

Edit:

Full code is here.

    public Result Search(int maxDepth)
    {
        int alpha = -int.MaxValue, beta = int.MaxValue, ply = maxDepth;
        var bestLine = new Stack<Move>();

        var score = AlphaBeta(alpha, beta, ply, bestLine);

        return new Result(score, bestLine);
    }
    int AlphaBeta(int alpha, int beta, int ply, Stack<Move> bestLine)
    {
        if (ply <= 0) return Evaluation.Evaluate(Board);
        var moves = Board.GenerateMoves();
        foreach (var move in moves)
        {
            Board.MakeMove(move);

            eval = -AlphaBeta(-beta, -alpha, ply - 1, bestLine);

            Board.TakeBackMove(move);

            if (eval >= beta)
            {
                return beta;
            }
            if (eval > alpha)
            {
                alpha = eval;
                if (ply == 1) bestLine.Clear();

                bestLine.Push(move);
            }
        }
        return alpha;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:50:19+00:00Added an answer on May 16, 2026 at 3:50 am

    OK, you are right on the MinValue/MaxValue thing.


    I’m a bit rusty about NegaMax and AlphaBeta but when I see

       if (eval >= beta)
       {
           return beta;
       }
       if (eval > alpha)
       {
       }
    

    You’re testing > for both limits, that doesn’t seem right.

    Edit: It seems just a naming/understanding issue of sorts. Your AlphaBeta() method could be named more accurately NegaMaxWithAlphaBeta(). Because of the alternating roles of alpha and beta in NegaMax the naming of those parameters is not an exact match with MiniMax.

    i see that algorithim encounter beta cut-offs but in my opinion, this should never occur

    Yes it should occur. And it’s only a beta-cutoff at the even ply-levels. At the odd levels, if (eval >= beta) tests for an alpha-cutoff.

    if i don’t use narrowed window.

    I think you are using a narrowing alpha/beta window.

    But maybe this answer can help you explain your problem better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this isn't strictly a programming question but y'all must have experienced this.
I've experienced rather strange behavior of JSTL forEach tag. I have some bean called
Most of experienced programmer knows data alignment is important for program's performance. I have
First of all: I am not an experienced ClearCase user, but I have lots
On the advice of a more experienced developer, I have always coded my web
I have experience in PHP, JSP/servelts and classic ASP, and I am trying to
Does anyone have experience using the URL Rewrite Module (see here )? Can it
I have noticed that Google Toolbox for Mac replaces several SQLite built-in functions (LOWER/UPPER,
I will be coding a website that will have Arabic as a supported language
I have experienced problems since moving to the latest version of one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.