Algorithms Explained – minimax and alpha-beta pruning
Video Overview & Insights
This video covers the minimax search algorithm, as well as how it can be sped up using alpha-beta pruning.
Loved how clearly you broke down minimax and alpha-beta pruning — AI can help with this kind of dense topic too. A handy productivity tip is
Pseudocode:
https://pastebin.com/VSehqDM3 - plain minimax
So when I tried to implement Negamax for my Chess engine, I found that the basic Negamax search worked but when I tried alpha beta pruning, it seemed to be deliberately avoiding checkmate????? I have no idea why because I thought I was following the exact steps, and I thought I was converting everything correctly...?
https://pastebin.com/rZg1Mz9G - alpha beta
Support the creation of more tutorials:
so nice
https://www.patreon.com/SebastianLague
awesome explication, got me to understand
More User Perspectives
我可以战胜ai
@ziqideng-o2dI am trying to write my own chess engine and your video was the most helpful one so far, tysm!!
@AmazingStopMotionsare you genius
@ghjadf3654ty
@AvamNeupane-qk9fdThank you!!! I'm in a class learning minimax and alpha-beta pruning algorithms and I felt completely lost after a couple lectures, but now i get it.
@MyghtyMediocreBest video about alpha beta pruning I've seen. Thank you so much
@monjasonsteng7861Благодарим ви!
@chavdarmarchev3666Excellent, really well explained, thank you!
@jocaro93I don't really understand the code and the alpha-beta part...
@ReginaJin-k9j+50 slides explained in 11 Mins ❤
@SuperNovaxFFI get mired in the details every time I read up on this, in spite of my CS degree. But then it was in the 1980s. And I am old. However, the idea is very clear. Stop searching when it's obvious non of the other child trees will get played by a sane, observant player. chatgpt claims older electronic chess computers didn't understand enough ( their programs were too simple) to do good move ordering, so they had to waste time. But they often don't look that deep anyway. I am thinking 1980s electronic chess computers with typical slow CPUs, under 10 Mhz roughly. 100 million instruction cycles per second, which is probably more like 30 million instructions per second. Some of those CPUs were 4 bits, which meant programs were even slower, when they had to do extra work to compensate for their small word size.
@michaelbauers8800Right children are always the unloved ones...
@samiourovgreat vid, thanks
@Cr0NiiX_I've been a subscriber for years and clicked on this video just now to help me with a midterm for my Intro to AI course not even realizing this was a Sebastian Lague video until I heard the voice. Crazy how me watching interesting code videos has lead to this!
@Squish_SquashPrune
@giulianogarridorocchetti4902This one single video explained a whole chapter so much better than my Indian professor who couldn't explain this in multiple videos
@Irteza-c6rIs alphabeta with pruning the only algorithm for such games?
@Georgios-ft5nmHey Sebastian, thanks for the walkthrough and explanation. This has made the picture infinitely clearer to me. I hope someone buys you a shot or something! Cheers
@Kasual1911I didn't quite understand why the code for alpha beta works?
@aaryanhindi20597:35 I don't understand, white might pick the node to the right of <=1, in case it is <=10. This would beat 3. So I don't think pruning is allowed. Please correct me if I'm wrong.
@MaxPicAxe7:33 I'm not understanding how this can be deduced. Isn't the possibility for max to play optimally and go down the right path still... possible? Since the rest of the values determine whether or not 1 is guaranteed
@KojoBaileyGreat video , thanks for sharing!
@mrb12865what a brilliant explanation, I rarely understand a topic from a single video but this time I understood the game playing algorithms just from this video
@taki9873One of the best explanation. I really like it that you explain it from intuition.
@jasonhe6947How come in this video you don’t have that annoying voice from your recent videos? You got superb over time I guess.
@baomaspiano7736This is genius. Saved a lots of computation calculation
@Jonathan_WenI don't get the pruning part though, because how can we assume that <=1 is the case in the parent? What if the other child was much bigger? We didn't even check?
@Taro-wd5uosee barsh.
@michaelstoll6167Such a great video thank you so much what my lectors explained in 30 pages u did in 11 minutes
@stealth1841Great video! Super understandable, clear, and well presented. Gave me a great start to my minimax algorithm for my Berkley PacMan assignment!
@tylerhilbig3974Thank you so much !!! Save my ass from the mid-turn exam !!! 😘😍😍
@JerryJiang-zg1qgThis is such a great explanation!!
@ashithshettycool, easy to understand. thanks for making the video
@DaDeckyzGot it thx
@irichxYou are the man
@charleslingande6673thank you
@jirkadolezal8127this is so well explained, thank you so much!
@mairalyssVery interesting, I wonder how such algorithm can be upgraded for a 3-players game, alpha-beta-gamma pruning with 3 maximizers of own individual scores?
@zix2421The best video ever
@wingedvictory8694this video has a different vibe
@RazamindsetWow. helped me a lot after struggling with it for days. thanks boss!
@AmanSiyaramPathakF**kin love this ❤
@deadlygaming7450Great explanation!
Thank you! It helped me a lot!
not a coder but a chess player, learning how stockfish works and reduces the processing load were fun to learn!
@ardasnnnnyou're the only one who provided code for alpha beta pruning tysm
@hgjgjfjfmdBeautiful explanation. Just implemented this for an assignment but didn’t understand it at all, this cleared it up 100% in under 10 min
@aa1234-h6v