Minimax with Alpha Beta Pruning

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024

Комментарии • 193

  • @bryanbocao4906
    @bryanbocao4906 6 лет назад +227

    Great explanation! Some important notes as well:
    1) only in a Max node can update the corresponding alpha, so does Min for beta.
    2) v can only be returned up to its parent
    3) alpha and beta can only be passed down from its parent
    4) cut the current node from the tree whenever alpha >= beta
    In the graph on the right whiteboard, shouldn't all the alpha, beta are initialized as -infinity and infinity, respectively?
    At 13:07, for the completeness of the logic flow, I think we should set the beta to be 2 in the node(v=2, alpha=8, beta= ), then because alpha(8) > beta(2), we prune the right subtree.

    • @rampage14x13
      @rampage14x13 5 лет назад +9

      all solid things to point out, thanks

    • @kingtqos1514
      @kingtqos1514 5 лет назад

      It works like a charm, Thanks!

    • @superuser8636
      @superuser8636 3 года назад +6

      Yeah, this algorithm is total shit

    • @imnacho4127
      @imnacho4127 3 года назад +4

      beta would never assigned the value of two; the function would return before that variable assignment.

    • @kevin-lamquesnel9067
      @kevin-lamquesnel9067 Год назад +1

      Thanks this helped me so much, you have no idea

  • @GauravYadavdv31
    @GauravYadavdv31 5 лет назад

    One of the best explanation, Thank you John Levine.

  • @dien2971
    @dien2971 5 лет назад

    Thank you, sir. You are a great teacher!

  • @amellperalta
    @amellperalta 7 лет назад +151

    Excellent explanation! The video is clear, concise, and precise. We want more videos from you. Please teach us more about AI.

  • @RahulSam
    @RahulSam 7 лет назад +133

    You are a great lecturer, not many people can do this.

  • @GtaRockt
    @GtaRockt 3 года назад +16

    Great teacher, got a B on my AI exam with your videos about tree search algorithms 👌 explained it way better in a couple of minutes than my teacher in an hour

  • @mkamp
    @mkamp 7 лет назад +38

    Thanks. That was my nth video on that topic and this time it clicked. Thanks for taking the time to go through it so deliberately. :)

  • @jabodey
    @jabodey 6 лет назад +14

    THANK YOU SIR! I finally know alpha beta pruning!!! Your explanation was crystal clear. If you taught my AI course, I would never ditch class!!

  • @laibaidrees7933
    @laibaidrees7933 Год назад +1

    Kindly sir make videos on graph and tree searching algorithms i.e. by bfs,dfs,uniform cost search in python.

  • @sagnik3105
    @sagnik3105 6 лет назад +12

    This definitely has to be the most thorough explanation I found on the topic. Thank you! :D

  • @mesosiderite4670
    @mesosiderite4670 Год назад +3

    I want to thank you sir,
    you have done what my teacher was unable to do, a good explanation,
    it took me three days to understand this, and finally I understood thanks to this video

  • @AdityaRaj_Purohit
    @AdityaRaj_Purohit 5 лет назад +5

    One of the best video on youtube to understand Alpha Beta pruning.
    Want more video like this to get more understanding of AI.

  • @PauloViniciusMoreiraDutra
    @PauloViniciusMoreiraDutra 3 года назад +2

    the best explanation about minimax. You are a great professor. I watched a lot of videos about minimax algorithm, but only your video I understood clearly

  • @dadas7852
    @dadas7852 7 лет назад +10

    This is the best video about this topic

  • @prasangsinghal262
    @prasangsinghal262 5 лет назад +4

    He saved my exam. Thnxx sir for such a great explanation.

  • @tonycui6891
    @tonycui6891 Год назад +1

    Alpha-beta pruning using {v, α, β}: 4:33

  • @TalkShowsNews
    @TalkShowsNews 5 лет назад +1

    love you best videos sir

  • @yashvats9703
    @yashvats9703 Год назад +2

    He is god. He explained everything in just 13 minutes. I wish if I came across this video earlier it could have saved my time. Great teacher!!

  • @alexanderyau6347
    @alexanderyau6347 6 лет назад +3

    Wow, this lecture helps me understand the alpha-beta algorithm, the pseudo code is very helpful to understand. Quite intuitive. Where is the link for the assignment?

  • @BossManTee
    @BossManTee 6 лет назад +1

    Do more videos for fuck sake please

  • @adamkawsara6881
    @adamkawsara6881 6 лет назад +2

    Wonderful video. This helped a lot! Working through the example in real time and explaining your thought process as you went really helped make this click.

  • @jonathancui3063
    @jonathancui3063 4 года назад +12

    As a self-learner, this video is by far the best explanation I've ever seen. Clean, concise, and to the point.

  • @j_m_b_1914
    @j_m_b_1914 2 года назад +1

    I must be missing something because the following scenario seems like a possible scenario where alpha beta pruning can discount a superior position down the road.
    In chess, isn't it possible to have a move sequence where moves 6 ply out may show an inferior score for white but if the line was analyzed further, we'd see that white might be able to force a mate by taking a material loss. Wouldn't alpha beta pruning possibly discount such a line by abandoning further computational depth for that line such that it would never be able to see that a temporary drop in maximization of white's score actually sets up for a win for white?
    I guess my question can be reduced to this:
    Is it possible for alpha beta pruning to discount a line that is temporarily inferior (low score) but a few moves further out we discover a forced mate? Could alpha beta pruning throw out the analysis for such lines?
    Also, the entire principle of the minimax algo (in my opinion) is the scoring we give specific positions based on what information has been learned about chess over the centuries. We rank certain material with specific scores and also certain positions with specific scores. If the methodology of scoring the current state of the chess game is imperfect, then the minimax algo may not always be 100% optimal in the search tree it explores based on those scores.
    Let me give a quick counter example to (hopefully) better illustrate my argument. In the game of chess, there is really only one ultimate score -- is there a sequence of moves from the current game position where white (or black if playing black) can force a checkmate of the opposing king. Every other analysis within the game is of no consequence if it doesn't lead to a line where the opposing king is checkmated (or if checkmating is not possible, the only other analysis of consequence is trying to draw the current game). A new chess engine called Oracle is created using hardware from thousands of years into the future. Oracle is able to analyze 100 ply within the game in a matter of microseconds. Oracle discovers a line where white sacrifices four pieces (let's say a pawn, a knight, a bishop and a rook) in order to force a mate on the opposing king approximately 20 moves out.
    Now in this example, wouldn't current engines stop processing this line after the first or second piece was lost because the minimax score / alpha beta pruning? The current engine might discount the sequence of moves and call the first sacrifice a blunder because it never processed this particular line deeper.
    I could be way off here because my knowledge of minimax with A/B pruning is incomplete -- that's why I'm throwing this out there for others with more experience. Is this a disadvantage of minimax with AB pruning?

  • @meharabdullah8608
    @meharabdullah8608 6 лет назад +2

    Fantastic explanation. No one on RUclips has ever explained this algorithm so nicely using it's pseudo code . Very nice Sir, Respect

  • @AntonAtef
    @AntonAtef Год назад +1

    Great explanation 👌

  • @nilsmartel2295
    @nilsmartel2295 4 года назад +2

    Every single time I see that you have uploaded a video about a topic, I lose all fear, that I'm not going to be able to understand it. This is not an exaggeration, you've helped me avoid so much confusion and desperation. Thank you so much John!

  • @oshawastaken
    @oshawastaken 2 года назад +2

    5 year later and still best video on alpha-beta pruning. Thank you sir.

    • @johnlevine2909
      @johnlevine2909  2 года назад +3

      Thanks for making me feel old! Very glad it's useful 😀

  • @andrewweems9427
    @andrewweems9427 7 лет назад +3

    Your videos are so concise and helpful. They're the only thing keeping my grade decent in my Intelligent Systems class.

  • @syedahabali2450
    @syedahabali2450 6 лет назад +4

    Respect to you sir. You explained it so well! I'm very grateful!

  • @fejohnson
    @fejohnson 6 лет назад +2

    this is amazingly helpful for me! thank you sir for this explanation!

  • @sergiovasquez5643
    @sergiovasquez5643 3 года назад +1

    Great presentation of work. would it be possible to link the supplementary material associated with this lecture?

  • @Noah-357
    @Noah-357 6 месяцев назад

    What would be a real life example ?. For example, when robo vacuum is trying to clean a house, what would be the example of pruning here ?. Is pruning happening when robo vacuum for example when it says task finish although it's not like skipping task because there are an obstacles blocking its way?

  • @nassimmehalli7043
    @nassimmehalli7043 6 лет назад +1

    an excellent teacher , thank's a lot. we'r waiting for more courses about AI :) Good luck

  • @freedomman1981able
    @freedomman1981able Год назад

    pruning can miss the best value returning. In the example, the best value should be 9 not 8. Pruning can accelerate the performance, but it not always give the best result (or best move).

  • @pellekools6475
    @pellekools6475 6 лет назад +2

    Great explanation! I already knew what steps to take, but it wasn't really clear why I should take those steps. It is clear to me now.

  • @dimmo15
    @dimmo15 6 лет назад +1

    Thank you sir! I was wondering if there is a formula that can calculate the maximum number of nodes that can be pruned in a tree with a depth of d and a branching factor of b.

  • @aynurememmedova9436
    @aynurememmedova9436 Год назад

    Thanks teacher...I watch your videos in Azerbaijan✨

  • @benaya6
    @benaya6 5 лет назад +1

    it's just amazing. all your videos are the definition of crystal clear explanation. perfect. I wish you'll do more videos

  • @cookiejar3094
    @cookiejar3094 5 месяцев назад

    Your videos help me so much with my course, thanks!

  • @tititiwon
    @tititiwon 3 года назад

    It would be cool if you pointed more often to the algorithm. Instead, it seems as if you were doing an interpretation and that is not true. You are following exactly as it is.

  • @mursheduzzamanrakib260
    @mursheduzzamanrakib260 6 лет назад +1

    Sir, would you mind making a series video for Artificial Intelligence... It will be more helpful...

  • @lijinhui6902
    @lijinhui6902 Год назад

    thank you for saving me from my lecturer....

  • @ImranAkbarUK
    @ImranAkbarUK 6 лет назад +1

    very good Explanation Sir! :)

  • @vinicius2699
    @vinicius2699 6 лет назад +1

    Damn, you are good. Thanks for helping

  • @jebaanto7649
    @jebaanto7649 3 года назад

    Awesome explanation sir thanks from india

  • @amirbaba9677
    @amirbaba9677 2 года назад

    this video was so helpful.
    thank you.

  • @nicolemb05
    @nicolemb05 Год назад

    This is so helpful!! Thank you so much!

  • @yutakoike7519
    @yutakoike7519 7 месяцев назад

    excellente!!! mi amo probes !!

  • @XxBleedRainbowxX
    @XxBleedRainbowxX 5 лет назад +1

    Just wanted to thank you for your great videos! Watching them pre-exam to refresh and they're all very clear and informative

  • @pedropt1486
    @pedropt1486 9 месяцев назад

    Obrigado. IA já está no bolso

  • @Orthodoxhasanswers
    @Orthodoxhasanswers 3 года назад

    why you not prune -2 ? 8>2 ?

  • @mohamedthajmeel9715
    @mohamedthajmeel9715 Год назад

    can min come at the top and be followed by max?

  • @johnphilipespia1167
    @johnphilipespia1167 3 года назад

    Thank you so much! You're the best!!

  • @guoshenli4193
    @guoshenli4193 3 года назад

    great explanation!!! Thank you!!!

  • @AGCrush
    @AGCrush 3 года назад

    Great Explanation! Thanks alot.

  • @ahsanshahid11
    @ahsanshahid11 6 лет назад +2

    bunch of thanks (y)

  • @madeline-qk3vg
    @madeline-qk3vg Год назад

    this is life-saving sir thanks a lot ^-^

  • @s70591520
    @s70591520 3 года назад

    this guy makes me wanna go back to school

  • @blackfromabove9383
    @blackfromabove9383 3 года назад

    Many thanks for explanation!

  • @shehrozkhan9563
    @shehrozkhan9563 2 года назад

    Love from Pakistan!!!!

  • @shantanulokhande3730
    @shantanulokhande3730 11 месяцев назад

    Thank you so much sir. !!!!

  • @sashinthat3173
    @sashinthat3173 Год назад

    Goated Explanation Sir!

  • @simoneditzzz
    @simoneditzzz Год назад

    thanks man, you gave me a great favor

  • @shehrozkhan9563
    @shehrozkhan9563 2 года назад

    Sirrr love your vids

  • @mohamedibrahimhassan291
    @mohamedibrahimhassan291 2 года назад

    loved the way you explaine

  • @mohamadhaydar3967
    @mohamadhaydar3967 2 года назад

    easy example, make a harder one🤭

  • @kiyimbafahad6169
    @kiyimbafahad6169 19 дней назад

    This is the hotest content online about this chapter!
    So concise and precise!🎉

  • @lenniegames3529
    @lenniegames3529 7 лет назад

    Is it at all possible to see the slides you mention in the video? I've spent the past couple of days trying to figure out how to apply MiniMax with Alpha-Beta Pruning to my A-Level Chess AI, and I always seem to get bugs that shouldn't exist (I literally mean they shouldn't exist, not I don't know why they exist), Thanks

  • @malcolmrodwell5458
    @malcolmrodwell5458 6 лет назад +1

    Amazing. Stick to the Lego though.

  • @pratyushshrivastava4362
    @pratyushshrivastava4362 6 месяцев назад

    Great explanation!

  • @Jantol93
    @Jantol93 2 года назад

    The best explanation of alpha beta pruning. "If the value is greater than beta that means min is going to prefer the branch that lead to beta." That line made it click for me.

  • @dijkstra5952
    @dijkstra5952 6 лет назад

    Is it just me or is he the actor who played Benjamin Linus from LOST (Michael Emerson)? He both looks and speaks exactly like Ben.

  • @BeSharpInCSharp
    @BeSharpInCSharp 4 года назад

    I have to admit you are the only one who could explain and impart knowledge to even the dumbest person like me. You are the great great teacher.

  • @nmt800
    @nmt800 6 лет назад

    Awesome explanation. Upvote. Please make videos explain, all alogrithms Thanks!

  • @konstantinrebrov675
    @konstantinrebrov675 4 года назад

    You did not define the term "pruning". What do you mean "that will show you where the search can be pruned"?

    • @beri4138
      @beri4138 4 года назад

      It means the search will never explore that path. Pruned nodes and their child nodes will be ignored by the minimax algorithm to save computing time.

  • @SentryProductions1
    @SentryProductions1 6 лет назад

    Would the -2 value not be pruned as we have a deep cut off situation ? We can see that Max will be = 8? Is there point in exploring -2?

  • @dgglovesbb
    @dgglovesbb Год назад

    Thank you so much!

  • @ريمالمحمد-ن2ت
    @ريمالمحمد-ن2ت Год назад

    Thank you for this amazing video and explaination, not many have the ability to do this 🌸🖤

  • @rv.9658
    @rv.9658 2 года назад

    Watching this once saves me so much time that might've gone into reading through a textbook section on this particular algorithm

  • @hamedbabagheybi3357
    @hamedbabagheybi3357 4 года назад

    Tnx you are so amazing

  • @ElminsterWindwalker
    @ElminsterWindwalker 9 месяцев назад

    Thank you sir !

  • @jonesmukuta1910
    @jonesmukuta1910 2 года назад

    Good work right there!!!

  • @tega2754
    @tega2754 7 лет назад +2

    Thank you!!! :)

  • @_justinxu
    @_justinxu 4 года назад

    Don't expect to instantly understand this topic, but your video did it. Thanks. :D

  • @hangchen
    @hangchen 4 года назад

    OMG! Very very clear! I came from CS188 step by step.

  • @Fionasfung
    @Fionasfung 2 года назад

    This is the best video I have seen which explains the algorithm along with the graph.

  • @beri4138
    @beri4138 4 года назад

    Very good video. I will now attempt to code my own tic-tac-toe solver :)

  • @TrangPham-kc7ft
    @TrangPham-kc7ft 4 года назад

    Thank you so much for your video. It's really clear.

  • @jennachen1411
    @jennachen1411 5 лет назад

    Thank you very very much! It takes a long time for me to understand the alpha-beta pruning .Luckly ,I find this vedio.

  • @ahlamalbimani2070
    @ahlamalbimani2070 6 лет назад

    Thank you. I've seen many videos and could not understand until I saw this video. Many thanks for your clear explanation!!

  • @Lukas-bb4sg
    @Lukas-bb4sg 8 месяцев назад

    Thank you

  • @김건우-t8s
    @김건우-t8s 11 месяцев назад

    Thanks. your explain is quit clear😊

    • @178_AMANKUMARSINHA
      @178_AMANKUMARSINHA 10 месяцев назад

      bsdk english to theek se bol le 6th pass ma ki chut

  • @bangminh5712
    @bangminh5712 7 лет назад

    Please make a video on Negamax as well, would be perfect if includes Transposition in the algorithm either. And thanks for the lesson, thank you.

  • @mahmoudsoliman2115
    @mahmoudsoliman2115 6 месяцев назад

    error 404

  • @matteomastandrea5680
    @matteomastandrea5680 Год назад

    this mans single handedly getting me through AI

  • @dbnnoman5596
    @dbnnoman5596 3 года назад

    Thank You so much sir!
    God Bless you!

  • @raaziyahshamim4761
    @raaziyahshamim4761 10 месяцев назад

    Great

  • @ammarzorig2771
    @ammarzorig2771 4 года назад

    Thank you Dr

  • @mertdusunceli5159
    @mertdusunceli5159 5 лет назад

    why does 8 get placed as alpha in the level 2 right node ?

  • @moondemudimba7920
    @moondemudimba7920 6 лет назад +1

    wow so clear