What is the Minimax Algorithm? - Artificial Intelligence

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 มิ.ย. 2024
  • The minimax algorithm is one of the oldest artificial intelligence algorithms ever. It uses a simple zero sum rule to find which player will win from a current position.
    This is arguably the most powerful and basic tool for building game playing artificial intelligence. It captures the intentions of two player games fighting against one another. Minimax is the foundation for algorithms like alpha-beta pruning and iterative deepening.
    Engines like deep blue use optimized versions of minimax to play chess, while other computer programs have also been successful at playing games with minimax.
    Source Code (Complicated, glance over the evaluate function to get a gist):
    github.com/gkcs/ChainReaction...
    00:00 Basic Game Tree
    01:17 Basic Algorithm - Winning
    03:42 Heuristics
    06:40 Benefits of Heuristics
    07:34 Thank you!
    #minimax #minmax #game-tree

ความคิดเห็น • 82

  • @garybuttherissilent5896
    @garybuttherissilent5896 ปีที่แล้ว +3

    This video is really great for getting across the intuition, thank you!

  • @junjieli9253
    @junjieli9253 4 ปีที่แล้ว

    Clear and helpful explanation. Thanks

  • @vaibhavbbd
    @vaibhavbbd 5 ปีที่แล้ว

    Very well explained.. Thanks !

  • @uday_kumar43
    @uday_kumar43 2 ปีที่แล้ว

    Really easy to understand thank you so much brother :

  • @fixer8173
    @fixer8173 7 ปีที่แล้ว +13

    Great explanation, made it easy for me to understand :)

    • @gkcs
      @gkcs  7 ปีที่แล้ว +2

      Thanks!

  • @shwetasharma7527
    @shwetasharma7527 5 ปีที่แล้ว +1

    Great video! Thanks a ton!!

    • @gkcs
      @gkcs  5 ปีที่แล้ว

      Thanks!

  • @sumanthduthuluru741
    @sumanthduthuluru741 3 ปีที่แล้ว

    hey man!....thanx for explaining.....May i knw how did you get the values for the leaf node?

  • @sheetalborar6813
    @sheetalborar6813 3 ปีที่แล้ว +1

    loved the heuristic example :)

  • @angelodou
    @angelodou 5 ปีที่แล้ว +3

    Perfect, thank you!

  • @krullebolalex
    @krullebolalex 5 ปีที่แล้ว +1

    Thanks a bundle!

  • @pommedemer1922
    @pommedemer1922 6 หลายเดือนก่อน

    really great explaination, thank you sir!

  • @omnacky
    @omnacky 3 ปีที่แล้ว +1

    Would it be possible to do a breadth-first search on the minimax tree instead of depth-first/iterative deepening? Or maybe iterative deepening can be done without visiting the same nodes so many times?

  • @ericwang8152
    @ericwang8152 5 ปีที่แล้ว

    Amazing!

  • @flayshon
    @flayshon 6 ปีที่แล้ว +1

    Thanks a lot! :D

    • @gkcs
      @gkcs  6 ปีที่แล้ว

      Thanks!

  • @sudhanshusharma7793
    @sudhanshusharma7793 5 ปีที่แล้ว +1

    Totally made the concepts clear , Thanlyou !!

    • @gkcs
      @gkcs  5 ปีที่แล้ว

      Thanks!

  • @fahmidhasan5313
    @fahmidhasan5313 5 ปีที่แล้ว +3

    easy and effective!

  • @zafirhasan1035
    @zafirhasan1035 5 ปีที่แล้ว +60

    0:40 you say positive infinity is a win for white and negative infinity is a loss for black. Shouldn't it be that negative infinity is a win for black because it is trying to get the lowest score?

    • @gkcs
      @gkcs  5 ปีที่แล้ว +18

      I messed up 😅, thanks for pointing that out!

    • @johnmadsen37
      @johnmadsen37 5 ปีที่แล้ว +10

      That’s racist!

    • @techfathi3039
      @techfathi3039 4 ปีที่แล้ว

      I have a question , how the heuristic function work ? 😞

    • @sarasitwat7188
      @sarasitwat7188 4 ปีที่แล้ว

      even i was thinking this

    • @samsingh0
      @samsingh0 2 ปีที่แล้ว +1

      @@johnmadsen37 really man

  • @jamietherooster
    @jamietherooster 6 ปีที่แล้ว +20

    Fantastic, explained better than any MIT, berkley video.

    • @gkcs
      @gkcs  6 ปีที่แล้ว +1

      Thanks Jamie :-)

    • @jamietherooster
      @jamietherooster 6 ปีที่แล้ว +2

      Thats cool, i am from Britain, you need to move here, we are crying out for good teachers like you, who can mix complexity with intuition. I only speak my native language, but you speak it far better than myself , very clear and concise.

    • @tamasflp
      @tamasflp 5 ปีที่แล้ว +1

      I came here from that video too. I would not say either of the videos is better or worse than the other, they just use different kind of interpretation. Both of them helped me to understand the topic deeper, so thanks for the video. :)

  • @swamysriman7147
    @swamysriman7147 4 ปีที่แล้ว +8

    0:38 *Win for Black

  • @fattymcbutterpants9700
    @fattymcbutterpants9700 4 ปีที่แล้ว

    Thank you

  • @taidusthealien
    @taidusthealien 3 ปีที่แล้ว

    How would this be applied to a fighting game do you know?

  • @tarunkumar-kz5xi
    @tarunkumar-kz5xi 6 ปีที่แล้ว +1

    Hi gaurav I am having a small doubt that how we handle the case if tree is not complete

    • @gkcs
      @gkcs  6 ปีที่แล้ว

      Hey Tarun, you can return the max/min among all the nodes with the same parent. For a single node you return the value itself. For any other scenario, you choose a win if any of the remaining nodes is a win for you. Else you choose a draw if any of the nodes is a draw. Else you have to choose a loss. So you are essentially using a Max(all child node results) to try to win.

  • @carloscabrerahernandez3663
    @carloscabrerahernandez3663 2 ปีที่แล้ว

    great vid:)

  • @vuongnguyenthien319
    @vuongnguyenthien319 5 ปีที่แล้ว +1

    that's so awesome

    • @gkcs
      @gkcs  5 ปีที่แล้ว

      It is 😁

  • @RideIndiaRide
    @RideIndiaRide 2 ปีที่แล้ว

    Easy and simple ❤️

  • @raghavatreya4533
    @raghavatreya4533 5 ปีที่แล้ว +1

    What tool you are using for presentation?

    • @gkcs
      @gkcs  5 ปีที่แล้ว +1

      Google Slides! 😁

  • @baidharsoren6656
    @baidharsoren6656 7 ปีที่แล้ว +6

    Awesome video !!
    Could you please also attach a link to a problem (beginner-friendly one :P) related to this topic ???

    • @gkcs
      @gkcs  7 ปีที่แล้ว +6

      Hi Baidhar!
      Thanks for the feedback!
      Here is a tic-tac-toe game you can use minimax on:
      www.hackerearth.com/practice/algorithms/string-algorithm/manachars-algorithm/practice-problems/multiplayer/tic-tac-toe/

    • @baidharsoren6656
      @baidharsoren6656 7 ปีที่แล้ว +2

      Thanks a ton !!

  • @alexzhukovsky8361
    @alexzhukovsky8361 2 ปีที่แล้ว

    good video

  • @5mwa
    @5mwa 6 ปีที่แล้ว +4

    Better explanation than MIT.

    • @gkcs
      @gkcs  6 ปีที่แล้ว +1

      Haha. I am honored overwhemingly :-)
      The profs there are awesome though.

  • @rohitjain9381
    @rohitjain9381 5 ปีที่แล้ว

    Which software did you use to draw and explain?

    • @gkcs
      @gkcs  5 ปีที่แล้ว

      Google Slides 😁

    • @rohitjain9381
      @rohitjain9381 5 ปีที่แล้ว

      @@gkcs Well that was quick. And btw I am a great admirer of your way of teaching. Really appreciate your efforts to make difficult concepts look easy. :)

    • @gkcs
      @gkcs  5 ปีที่แล้ว

      Thanks!

  • @utseb1
    @utseb1 7 ปีที่แล้ว +1

    how to apply the minimax algorithm to the card game "Beat the Buzzard"?

    • @gkcs
      @gkcs  7 ปีที่แล้ว +3

      Hey utseb1,
      Please describe the question in detail here.

    • @utseb1
      @utseb1 7 ปีที่แล้ว +1

      i want to find the best strategy for this game www.funagain.com/control/product?product_id=012770&reviews_show_all=Y and I want to apply the minimax algorithm but I have no idea how because it is an imperfect information game

  • @jennyjenjira4572
    @jennyjenjira4572 ปีที่แล้ว +1

    I understand because of this

  • @prathampatel582
    @prathampatel582 2 ปีที่แล้ว

    tomorrow is my exam and you are clearing my doubts in 5 mins which my bozo prof was not able to do in 6 months 😇

  • @divija6361
    @divija6361 2 ปีที่แล้ว

    I was listening very seriously til hagrid came on screen!

    • @divija6361
      @divija6361 2 ปีที่แล้ว

      Oh we have aragog on the book too!

  • @blasttrash
    @blasttrash 3 ปีที่แล้ว

    which site are you using to present this? Can anyone tel?

    • @gkcs
      @gkcs  3 ปีที่แล้ว +1

      Google slides :)

    • @blasttrash
      @blasttrash 3 ปีที่แล้ว

      @@gkcs Thanks

  • @adraxer12
    @adraxer12 4 ปีที่แล้ว +2

    Why this is so ez with you but not with ma proffesor. He was shittalking about it in 30 minutes but you explained it in on video and I am not even native english speaker!

  • @stickguy9109
    @stickguy9109 3 ปีที่แล้ว

    When in doubt follow the spiders

    • @gkcs
      @gkcs  3 ปีที่แล้ว

      Hahaha! Heuristic right there :D

  • @powerofkek349
    @powerofkek349 2 ปีที่แล้ว

    toward the beginning, "positive infinity would be a win for white, and negative infinity would be a loss for black" means white always wins!

    • @gkcs
      @gkcs  2 ปีที่แล้ว

      Damn, I should have thought that through :p

  • @jayeshrelkar5798
    @jayeshrelkar5798 ปีที่แล้ว

    What is R & B...?

    • @gkcs
      @gkcs  ปีที่แล้ว

      Red and Blue.

  • @muckalica96
    @muckalica96 6 ปีที่แล้ว +4

    positive infinity would be win for white and negative infinity would be loss for black :D

    • @gkcs
      @gkcs  6 ปีที่แล้ว +1

      Yup!

    • @muckalica96
      @muckalica96 6 ปีที่แล้ว

      Gaurav Sen loss for black is the same thing as win for white isn’t it?

    • @rajasdeshpande7430
      @rajasdeshpande7430 5 ปีที่แล้ว

      Ya, is should have been win for black

  • @arnabchakraborty6943
    @arnabchakraborty6943 3 ปีที่แล้ว

    Thank you thank you thank you sooo much dada....by the way are you junior from me or senior?I am now 27+.So can I call you by your name or I call you as dada?

    • @gkcs
      @gkcs  3 ปีที่แล้ว +1

      Gaurav is fine 😁

    • @arnabchakraborty6943
      @arnabchakraborty6943 3 ปีที่แล้ว

      @@gkcs Ok so gaurav you and me we are off same age right?will you be my friend gaurav?facebook e aachho tumi?are you in facebook?

  • @Scaw
    @Scaw 4 ปีที่แล้ว +1

    The diction is too fast and badly delivered. Couldn't understand much of it.

    • @partha95123
      @partha95123 4 ปีที่แล้ว +2

      Why can't you reduce the speed and watch the video till you understand!

  • @ankurgupta2180
    @ankurgupta2180 2 ปีที่แล้ว

    Positive infinity win for white
    Negative infinity loss for black
    In both cases black is losing.

    • @gkcs
      @gkcs  2 ปีที่แล้ว

      Yeah I messed that up 😅
      Negative infinity is a loss for white

  • @ndis1977
    @ndis1977 5 ปีที่แล้ว +1

    No bashing or anything , but really badly illustrated