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

  • SEARCH
  • Home
  • 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 am trying to create aseries of maps with markers. I have experienced, that
I have experienced Zend Framework 1 and I've build some apps with that framework.
I am an experienced WinForms/WPF/Silverlight developer and have an interview for a product that
I am new to Git and this is the first time I have experienced
I've seen a number of blog posts, and have experienced for myself, that Mercurial
I have experienced in numerous implementations that an image <img> wrapped by an <a>
I have implemented a generic ObjectPool class but have experienced that it sometime deadlocks
I'm rather new to Ant but I have experienced it's quite good pattern to
Essentially, my question is this: There are two ways that I have experienced setting
Maintaining unit tests is difficult. I am sure that we all have experienced a

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.