Beating Connect 4 with Graph Theory

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ม.ค. 2025

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

  • @sorin_markov
    @sorin_markov 6 หลายเดือนก่อน +182

    In case you missed it, there are two communities you can join linked in the description! One is for 2swap the man himself and one is a connect four server that I totally have no vested interest in :)

  • @gridddo
    @gridddo 6 หลายเดือนก่อน +442

    guess its time to watch another really well made connect 4 video i dont understand

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +40

      :')

    • @neon_Nomad
      @neon_Nomad 6 หลายเดือนก่อน +2

      Graph Theory is just determining the set of all eventualities.

    • @CaptTerrific
      @CaptTerrific 6 หลายเดือนก่อน +14

      @@neon_Nomad ...are you saying Graph Theory is my ex-wife's lawyer!?

    • @JorgetePanete
      @JorgetePanete 5 หลายเดือนก่อน

      it's*
      don't*

  • @tsanguine
    @tsanguine 6 หลายเดือนก่อน +110

    "So far we've been interested in strategies of connect 4," instant sub. straight to the point. i love you.

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +10

      💘

  • @rafthesheep
    @rafthesheep 6 หลายเดือนก่อน +161

    time for more "i don't remember this channel but i love past me for subscribing" content

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +17

      :D

  • @matthewlehner4747
    @matthewlehner4747 6 หลายเดือนก่อน +59

    5:34 "we can now delete all other children"
    is hilarious out of context

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +15

      I knew someone would bring this up 🤣

    • @TheArtOfBeingANerd
      @TheArtOfBeingANerd 5 หลายเดือนก่อน +3

      Was about to comment this lmao

  • @jay-tbl
    @jay-tbl 6 หลายเดือนก่อน +21

    thinking of strategy in games as a compressed version for the actual solution is mind blowing

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

      That's exactly what it is!

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +14

      I really appreciate this comment lol, it's the first one to actually directly acknowledge the thesis of the video 😅

  • @sorin_markov
    @sorin_markov 6 หลายเดือนก่อน +98

    As a connect four expert, I understood about 5 of these words.

    • @ethanchristensen7388
      @ethanchristensen7388 6 หลายเดือนก่อน +14

      As a computer science/math student, I understood all but about 5 of these words.

    • @asheep7797
      @asheep7797 6 หลายเดือนก่อน +8

      As a drunkard, I understood the part where he talked about dancing dinosaurs.

    • @lumiey
      @lumiey 5 หลายเดือนก่อน +1

      connect + four

    • @oceannuclear
      @oceannuclear 21 วันที่ผ่านมา

      I think you might be the prisoner who memorized Mona Lisa.

  • @MusicBent
    @MusicBent 6 หลายเดือนก่อน +36

    I built a solved connect 4 opponent on a raspberry pi, that would use image processing play you on a physical board. I used minimax with ab pruning. I could only go about 4 or 5 moves ahead within a reasonable amount of time. This is a really clever way to optimize the large tree of future moves. Wish I had thought of it then

    • @axa122
      @axa122 6 หลายเดือนก่อน +1

      sounds neat. how much time did it take to process those moves?

  • @an_asp
    @an_asp 6 หลายเดือนก่อน +7

    I used to be a teaching assistant for a class on search-based AI and minimax, so I am very happy to see such a well-made video on something so near to my heart. The visualizations of the state graphs showing the structure were extremely cool, and I'm excited for the insights you teased at the end! Connect four is way denser in transpositions than most games I'm used to like chess!

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +2

      Hell yeah, I'm glad you liked it!
      My initial reaction to your comment was to say, yeah, that's exactly right that connect 4 is oozing with transpositions in a way that chess isn't- but now I'm wondering if that's actually the case. I guess it depends on whether by transpositions you mean the strict notion of arriving at the same spot from 2 different paths, or in a looser sense of arriving at two positions whose continuation trees are isomorphic to each other. Honestly I am not so good at chess as to have a strong opinion, but I would be hesitant to say that chess doesn't manifest a bit of the latter kind of transposition. Maybe it's just harder to abstract out patterns from the noise in chess, and therefore harder to see the transpositions. Not sure!!

  • @VivianAttler
    @VivianAttler 6 หลายเดือนก่อน +25

    HES BACK!!!!! LETS GOOOOOOOOOO

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +3

  • @warguy6474
    @warguy6474 6 หลายเดือนก่อน +7

    Every time i watch these game + graph theory type videos im always amazed and in awe of the beauty of such simple games. I really have to try implementing something like a basic minimax one day

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +1

      Definitely give it a shot!

  • @olliebop1
    @olliebop1 6 หลายเดือนก่อน +23

    YES NEW 2SWAPPPPP I LOVE CONNECT 4 THEORY

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

    This is an incredible video. For a while I have been thinking about a pretty similar thing (in the context of optimal rubik's cube solutions), but I haven't actually put this idea into practice. I'm very excited for the next video.
    Also very cool graphs. I recently wrote a program to draw graphs, but my simulation was limited to 2d. It's nice to see how much that kind of thing can be improved with 3d simulation.

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +2

      similar video on rubiks cubes coming soon-ish!

  • @twoswap
    @twoswap  6 หลายเดือนก่อน +35

    I am sad, why are there so many yucky compression artifacts on the video :(
    I wonder if youtube is still doing some postprocessing or something... the black background behind the graphs doesn't look nearly as fuzzy or blocky on my end

    • @Ns-uo2um
      @Ns-uo2um 6 หลายเดือนก่อน +11

      I came to comment specifically to commend your animations, they look so clean and well thought out that it’s actually crazy. I am sorry it wasn’t exactly what you intended, but what it is is an amazingly crafted and beautiful video, so thank you so much for giving us quite possibly the best connect 4 video on the internet.

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

      Thank you 🥹 im glad you liked it!!!

    • @mathboy_
      @mathboy_ 6 หลายเดือนก่อน +7

      Ironic that a video about compression would suffer from it's own subject!
      It's possible that uploading the original video in 4k would increase the bitrate and decrease compression at higher resolutions. Something to maybe keep in mind for future videos.

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +9

      yeahhh. I'm gonna have to play around with it a lot. I'm passing a whole bunch of params into ffmpeg which seem relevant and are definitely tweakable, but I optimized that stuff ages ago up to how it looked on my end as opposed to youtubes end :/

    • @sabinrawr
      @sabinrawr 6 หลายเดือนก่อน +2

      If it helps, I watched on my phone, so much of the fine artistry was lost on me. 😭

  • @lit_kzh
    @lit_kzh 6 หลายเดือนก่อน +3

    started this video and immediately went on a tangent to watch every other video on the channel to get caught up lol. watching it for real this time!

  • @axiezimmah
    @axiezimmah 5 หลายเดือนก่อน +7

    Therapist: left hand on top Mona Lisa doesn't exist, it can't hurt you.
    7:58

    • @twoswap
      @twoswap  5 หลายเดือนก่อน

      lol

  • @ees4.
    @ees4. 6 หลายเดือนก่อน +3

    A new 2swap video! I used to watch these when they first came out while I was in school, before dropping out, these are so well-explained and easy to follow!

    • @sorin_markov
      @sorin_markov 6 หลายเดือนก่อน +4

      Goodness, has our little community been going long enough for people to be nostalgic about it now?

    • @ees4.
      @ees4. 6 หลายเดือนก่อน +1

      ​@@sorin_markov Seemingly so.

  • @communist4trump
    @communist4trump 5 หลายเดือนก่อน +1

    hard to put into words how much i love + appreciate these videos, thanks a lot for making this

    • @twoswap
      @twoswap  5 หลายเดือนก่อน

      Thanks!! :)

  • @haugenmitch
    @haugenmitch 6 หลายเดือนก่อน +3

    Another great video! I can't wait to see what's next!

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

      😄

  • @christophergilbert5988
    @christophergilbert5988 6 หลายเดือนก่อน +2

    this is actually insanely cool, subbed!

  • @SynchroFPS
    @SynchroFPS 6 หลายเดือนก่อน +5

    The goat has returned

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +1

      Quit my job so I have a lot more free time now 🐐😎

  • @PunmasterSTP
    @PunmasterSTP 6 หลายเดือนก่อน +1

    Those graphics were incredible and so beautiful to watch! I also heard about the game of Connect 4 being solved back in the 80s, but didn't really know that much about its solution.

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +1

      Thank you!!

  • @JohnMazz
    @JohnMazz 6 หลายเดือนก่อน +1

    Love this, yet another great one thank you! Keep it up

  • @SirLightfire
    @SirLightfire 5 หลายเดือนก่อน +2

    This video is only 10 minutes, yet it feels like a full lecture on advanced algorithms and data structures
    I'm gonna need some time to absorb this one

  • @benruniko
    @benruniko 5 หลายเดือนก่อน

    That… that is incredibly clever!! I never considered weak solutions as a thing, and applied theories specifically for networks is pretty brilliant.

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

    We are so back

  • @andermium
    @andermium 6 หลายเดือนก่อน +1

    Okay fine I'll watch the previous parts too lmao. I kept ignoring this rabbit hole, but I've finally clicked on it at 2am now and it's totally worth it to watch without being tired

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +1

      mwahahahaha

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

      @@twoswap alright, caught up. Can't wait for next episode!

  • @Bleuthatup
    @Bleuthatup 6 หลายเดือนก่อน +16

    Based and 4pilled

  • @axa122
    @axa122 6 หลายเดือนก่อน +1

    very clear explanation and visuals, nice channel

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

      Thank you!

  • @minikretz1
    @minikretz1 6 หลายเดือนก่อน +2

    amazing graphics! keep it up!

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

      Thanks :D

  • @fatih3806
    @fatih3806 5 หลายเดือนก่อน

    That Mona Lisa analogy is the best thing I’ve heard

  • @danielhobbyist
    @danielhobbyist 6 หลายเดือนก่อน +1

    I did something like this for a variation of the 15 puzzle (with multiple solution states) once for a school project. Wish I saw this, it would have saved me a good bit of time with the ideas.

  • @toburr
    @toburr 6 หลายเดือนก่อน +2

    we are so back, we are the most back, the backest!!

  • @evidenceofgriefing4617
    @evidenceofgriefing4617 5 หลายเดือนก่อน +1

    I dont understand how but after about two years in middle school of playing the max difficulty connect 4 computers, I've become unbeatable (I always tie or win). I'm curious to see how this video deepens or changes my understanding of the game and my undetsanding of it.

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

      connect 4 bots are generally very un-creative p2 players

  • @Agadr
    @Agadr 6 หลายเดือนก่อน +1

    very underrated channel

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

      Thank you!

  • @viktorzzxz
    @viktorzzxz 6 หลายเดือนก่อน +5

    Let's fucking go another connect 4 dub for the boys

  • @busy_beaver
    @busy_beaver 5 หลายเดือนก่อน +1

    Very cool visualisations!

    • @twoswap
      @twoswap  5 หลายเดือนก่อน

      One of my next few videos is gonna be about the busy beaver function 👀

    • @busy_beaver
      @busy_beaver 5 หลายเดือนก่อน

      @@twoswap, that's nice! I actually named my channel after the BB function

  • @JoeLitty
    @JoeLitty หลายเดือนก่อน +1

    I think that is (the most) how chess engines work

  • @hjaltetoes8837
    @hjaltetoes8837 6 หลายเดือนก่อน +1

    wow, nice video. Very well made🙌🙌🙌

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

      Thank you!!

  • @TheAntondi
    @TheAntondi 6 หลายเดือนก่อน +1

    Here it is, the generalisation I've been waiting for. Discrete mathematics rock!

  • @andrewharrison8436
    @andrewharrison8436 6 หลายเดือนก่อน +2

    The full tree is an example of data not information, colouring the nodes according to minimax starts to add information but it still isn't really the same as knowledge of the game's structure.
    For a practical learnable strategy there needs to be a "why" for each choice. Everybody who plays connect 4 will acknowledge situations where the next move is "forced" in that it gives a win or avoids a loss. Stronger players look further ahead so have more comples "why"s. To be expert you would need either a means of prunning the tree or strategies that avoid the tree altogether.

  • @louisreinitz5642
    @louisreinitz5642 6 หลายเดือนก่อน +7

    It's not actually a tree, two moves each can end up at the same place if moves are transposed.

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +2

      tree, dag, you get the idea 😅

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

    This man is the goat omg

  • @garryschniderham8291
    @garryschniderham8291 6 หลายเดือนก่อน +3

    I made Connect 4 on my graphing calculator, I want to make it play against me but I'm too lazy, cool vid

  • @Noah-lj2sg
    @Noah-lj2sg 5 หลายเดือนก่อน

    Awesome video. I love math visualization

  • @NightmareCourtPictures
    @NightmareCourtPictures 6 หลายเดือนก่อน +3

    Billy Butcher would like to know your location.

  • @jacksonpope3473
    @jacksonpope3473 5 หลายเดือนก่อน

    That Mona Lisa analogy was fucking awesome!

  • @NepYope
    @NepYope 6 หลายเดือนก่อน +1

    fantastic video

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

      Thanks!!!

  • @CompanionCube
    @CompanionCube 6 หลายเดือนก่อน +3

    1:18 but there are duplicates? (exact duplicates, not mirrors like mentioned later)

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

      Those aren't double counted (which is the reason the table shown gets slower than 7^n at 3 moves.) Sequences 147 and 741 are (at least in this video) treated as the same node. That's also why some of the trees shown have loops in them :)

  • @Byron_Vega
    @Byron_Vega 6 หลายเดือนก่อน +1

    Awesome video!

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

      Thanks!

  • @amelioravictoriadionyssia3323
    @amelioravictoriadionyssia3323 16 วันที่ผ่านมา

    This is literally how my brain sees chess. I see it as a tree of moves but instead of thinking about it too much I just allow myself to choose the move thats intuitively the best. I have beaten a grand master this way before, but I'm nowhere near a professional player

  • @MusicBent
    @MusicBent 6 หลายเดือนก่อน +1

    I built a solved connect 4 opponent on a raspberry pi, that would use image processing play you on a physical board. I used minimax with ab pruning. I could only go about 4 or 5 moves ahead within a reasonable amount of time. This was plenty to beat most human opponents. This is a really clever way to optimize the large tree of future moves. Wish I had thought of it then.
    I also played about 1000 games in the time, and studied James Allen and Victor Allis’ brilliant papers. Both are great reads in my opinion! 😉

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +1

      Thats super cool, especially with the image recognition!

  • @timbertrand1136
    @timbertrand1136 4 หลายเดือนก่อน

    Great content

  • @MickeJagger
    @MickeJagger 5 หลายเดือนก่อน

    Wow that's helps me understand graph theory

  • @alexsere3061
    @alexsere3061 5 หลายเดือนก่อน

    Man, after learning about this solution for connect four, i dont even imagine how useless the solucion for chess will be. Probably completely unusable. Thanks for the video, as someone who participated in math competitions, this side of the "there is always a winning strategy" is a new perspective for me

  • @adon155
    @adon155 6 หลายเดือนก่อน +2

    3:30 animation looks cool but its kinda hard to see whats happening to actually understand it

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

      Ahh man, I did not appreciate until now how faint it looks on OLED screens. That's probably why? Rendered it on desktop.

  • @parsatalaie9892
    @parsatalaie9892 6 หลายเดือนก่อน +2

    WOOOOOOOOOOOOOOOOOOO

  • @RPG_Guy-fx8ns
    @RPG_Guy-fx8ns 6 หลายเดือนก่อน +2

    To avoid combinatorial explosions, maybe try focusing on the end of the game, and forget about turn order. there are only 3 ways to win, horizontally, vertically, or diagonally, and those problems are transposed around the board. Your strategy to defend against these should not be in a global coordinate space, but local strategies relative to the dangerous arrangement. It should mix 2 strategies, defense and offense, depending on how dangerous the board is.

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +2

      This is very similar to the idea in Victor Allis's paper (the one linked in the description!) Unfortunately, or at least with respect to that paper, that thought process was only considered formally with regard to the defensive aspect on behalf of player 1, and was used to show formally without search that the game is _at least_ a tie or better for player 1. Further search was required to show that the offensive endeavor on behalf of player 1 bears fruit.

  • @neioni
    @neioni 6 หลายเดือนก่อน +2

    mm yes i am going to forget all of this 30 minutes after closing the video

  • @kevinhopper2493
    @kevinhopper2493 6 หลายเดือนก่อน +1

    This is so impressive! Do you have any suggested reading/literature/channels that go into more detail on graph reduction?

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

      ...no, sorry :'|

  • @GordonThompson
    @GordonThompson 5 หลายเดือนก่อน +1

    @2swap I'm really interested to see if you can prune enough via heuristics to create a human-learnable undefeatable strategy for the first player. Based on my own C4 experience I would guess that it is possible.

    • @twoswap
      @twoswap  5 หลายเดือนก่อน +1

      thats what I'm aiming on here :) I've pulled it off for about ~15% of openings so far, and I suspect I can keep on chugging along. It will take time and work (hence the filler videos haha)

    • @GordonThompson
      @GordonThompson 5 หลายเดือนก่อน +1

      ​@@twoswap you're killing it 🫡

  • @Madisongs
    @Madisongs 15 วันที่ผ่านมา

    This went from zero to a hundred real fast. I’m taking statistics and I already perceived this game as a sort of tree diagram with nodes and children, but then everything after that just like… I don’t know, you lost me 😅 great vid though, super entertaining

  • @phailupe2941
    @phailupe2941 6 หลายเดือนก่อน +1

    Hell yeah

  • @Mint-t4d
    @Mint-t4d 6 หลายเดือนก่อน +2

    for anyone who wanats to know geting rid of the bad options as seen at the beggining is called alpha beta pruning

  • @HelloIAmAnExist
    @HelloIAmAnExist 6 หลายเดือนก่อน +1

    1:30 why does the pattern not just continue as powers of 7? Other than 1 side being completely full or someone winning (both of which shouldn't be possible by the second move), how could the number of possible moves decrease?

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +4

      the same reason the graphs animated are DAGs and not strict trees (in the sense that undirected cycles can come up). you can get to the same position by several different ways. For example, red plays column 1, yellow column 4, and red column 7, or the other way around (7 4 1.) You land in the same spot.

    • @HelloIAmAnExist
      @HelloIAmAnExist 6 หลายเดือนก่อน +1

      @@twoswap ohhh that makes sense.

  • @adkand1234
    @adkand1234 6 หลายเดือนก่อน +1

    i dont know what Im watching but im interested

  • @Fathomthiz
    @Fathomthiz หลายเดือนก่อน +1

    Me playing connect four with 2 Swap.
    Me:heh heh heh, I got him right where I need him, is bet he's feeling stuck right now.
    2swap: 2:03

  • @Limofeus
    @Limofeus 6 หลายเดือนก่อน +1

    This is interesting, but yea, as people say it's pretty hard to wrap the head around all of that ha ha

  • @srengp3805
    @srengp3805 6 หลายเดือนก่อน +3

    Now do it with chess

  • @juusot8859
    @juusot8859 6 หลายเดือนก่อน +1

    Shouldn't the game tree actually be a DAG if we're talking about things like canonicalisation (elimination of mirror positions)? Never mind that you can reach the same position via many paths, i.e., the first optimization anyway is putting the positions in a hash table instead of storing them naively... maybe this was mentioned.

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

      It absolutely is a dag, canonicalized or not!

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

    This reminds me of IBM's Deep Blue project.

  • @willthompson6917
    @willthompson6917 5 หลายเดือนก่อน

    "We can now delete all other children" - average computer scientist

  • @woekin
    @woekin 5 หลายเดือนก่อน +1

    are the nodes connected when they match another board exactly but the journey was in a different order? Also could you use TSNE?

    • @twoswap
      @twoswap  5 หลายเดือนก่อน

      Yep, nodes correspond to board states, not move sequences, and thus transpositions form undirected cycles. Nothing is stopping you from using TSNE, but thats not what I'm going for here- I still want to be able to discern graph structure, not just identify subcomponents.

  • @fx-modding
    @fx-modding 5 หลายเดือนก่อน

    My graphics card laughs at the thought of only calculating 4 trillion nodes. Time to spin up cuda xD

  • @NesiAwesomeness
    @NesiAwesomeness 6 หลายเดือนก่อน +1

    How did you make the trees visualisation?

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

      my own tool! github.com/2swap/swaptube

  • @mrpocock
    @mrpocock 5 หลายเดือนก่อน +1

    I don't think you mentioned transpositions, where different move orders reach the same game state. A lot of strategies rely upon these as a sort of knowledge compression trick.

    • @twoswap
      @twoswap  5 หลายเดือนก่อน +1

      At least with respect to the representation im using here, transpositions are already diagrammed as (undirected) cycles in the graph. Super helpful, but at the same time, if your goal is to compress the graph itself, those transpositions are _already being taken into account_, in some sense!

    • @mrpocock
      @mrpocock 5 หลายเดือนก่อน +1

      @@twoswap out of interest, what are you using to plot those 3d graphs ?

    • @twoswap
      @twoswap  5 หลายเดือนก่อน +1

      its all 100% custom, the repo is in the description! You are looking for the file called OrbitScene3D.cpp.

    • @mrpocock
      @mrpocock 5 หลายเดือนก่อน +1

      @@twoswap very nice work

  • @stickpfp6347
    @stickpfp6347 5 หลายเดือนก่อน +1

    Guys, I actually learned about Minimax in universal paper clips, please applaud me and give me a standing ovation 😎😎😎

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

      👏👏👏

  • @NormieDead
    @NormieDead 5 หลายเดือนก่อน

    can you teach.? how you make those cool things ?

  • @PremierSullivan
    @PremierSullivan 6 หลายเดือนก่อน +1

    Fyi the visualizations are hard to read on the phone screen.

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

      Yeah ;-; I only realized after posting how bad it looks on OLED

  • @luisisaurio
    @luisisaurio 6 หลายเดือนก่อน +1

    You should be able to cut the # of games in half because of symmetry.
    Won't help at all, but I love symmetries :)

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

      For any given board configuration, flipping the board 180 degrees gives you a new configuration which has the same outcome

  • @ees4.
    @ees4. 6 หลายเดือนก่อน +1

    What did you use to animate this video?

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +1

      my own custom bespoke tool: github.com/2swap/swaptube

    • @ees4.
      @ees4. 6 หลายเดือนก่อน +1

      @@twoswap ooh, this tool is cool!
      I suppose I have a reason to learn c++ now (as I want to get into animating similar styles of videos) or just port it to java or rust (which I am already learning.)

    • @twoswap
      @twoswap  6 หลายเดือนก่อน +1

      ​@@ees4. Man i need to learn rust lol.
      If you start doing anything of the sort, tell me about it before hand :D i might be able to help or something. I thought about porting to rust myself

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

      @@twoswap i'll let you know when i stop procrastinating and start porting ;D

  • @gunaysoni6792
    @gunaysoni6792 6 หลายเดือนก่อน +1

    4 trillion is fairly small right? You could brute force it

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

      Not without a/b pruning and fancier methods than pure minimax! Or maybe with some super super pricey compute...

  • @nadyanabahi8259
    @nadyanabahi8259 6 หลายเดือนก่อน +1

    Why isn't this a SoMEpi submission?

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

      Don't know anything about SoME or the submission process, do I just slap the #SoMEPI in the title?

  • @kaya-sem
    @kaya-sem 5 หลายเดือนก่อน

    How are these graphs visualised? A game engine? Custom written program?

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

      custom, see swaptube in the description

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

    Is it really the case that nobody's made a strong solution for connect 4? For chess the 7-man tablebases have ~140 trillion positions iirc, 4 trillion hardly seems intractable (especially considering the simpler rules). On a few minutes thought it does seem nontrivial to enumerate the reachable terminals, but it should be doable. And reverse movegen for connect 4 is a lot simpler than for chess.

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

      Well, John Tromp "strongly solved" connect 4 a while back, but what is really meant by that is he figured out who is winning at all positions _only up to a depth of 8_. That was in the early 90's, and he says (tromp.github.io/c4/c4.html) it took 40,000 hours of compute to do so.
      But, it seems this reddit post from just 2 years ago claims to have constructed the entire solution on disk, taking up 15 terabytes: www.reddit.com/r/boardgames/comments/12bkis3/a_complete_lookup_table_for_connect4/?rdt=42183
      So I suppose it's doable, but I would maintain that on everyday compute it isn't doable within a reasonable amount of time. Fhourstones takes about a minute to _weakly_ solve c4 on my desktop, which is a tiny fraction of the required work.

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

    > we can't do this for four trillion nodes
    Sure we can! I'm fairly certain I can log in to the network of computers provided by my uni and do it right now if I want to. 4 trillion isn't that much when you know CPU clocks are at about 5 billion / second and you can pool many cores together to get the result very quickly

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

      ok now scale up to an 8x8 board and try that :3

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

    It's not just a theory, its... Graph Theory???

    • @sergey1519
      @sergey1519 28 วันที่ผ่านมา

      it is also Game Theory

  • @Ygenish1
    @Ygenish1 6 หลายเดือนก่อน +1

    i find it funny how you're mentioning "in-reality a memory couldn't bare this task" while there are chess GM who are remembering thousands of endgame positions, and can recall games from a certain position without context... Magnus is said to remember more about 10,000 games and most GMs can play a near perfect endgame without seeing the board.
    So I think that yes, a human can be a master in connect four without realising the entire context of his play.

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

      there's a universe of difference between memorizing enough to be proficient vs memorizing enough to guarantee optimal play

  • @bigzigtv706
    @bigzigtv706 6 หลายเดือนก่อน +1

    Now do this but for go

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

      lots of go vids coming sooner or later

    • @bigzigtv706
      @bigzigtv706 6 หลายเดือนก่อน +1

      @@twoswap 🔊📣📢

  • @jordanmuller2536
    @jordanmuller2536 4 หลายเดือนก่อน

    This is why I stopped playing Connect Four, too many sweats

  • @API-Beast
    @API-Beast 5 หลายเดือนก่อน

    You say that 4 trillion is too much to compute, but that's not really true. If you computed 1 million nodes per second (easily doable in a system language like C) you would need just 46 days for the computations to finish. An experienced programmer could probably go far beyond 1 million/s.

    • @twoswap
      @twoswap  5 หลายเดือนก่อน

      ...i don't want to wait 46 days!

  • @w花b
    @w花b 6 หลายเดือนก่อน +2

    Nowadays, people would brute force everything with deep learning. That's how you actually solve problems. Only a very small amount should require hammering with deep learning. And the brain consumes much less energy than these data centers with thousands of GPUs so it's better for the environment.