Beating Connect 4 with Graph Theory

52,837
0
Published 2024-07-18
I had way too much fun with 3d graphics this time.

Some references:
Amount of nodes after n plies: oeis.org/A212693 / web.archive.org/web/20160323025034/http://www.tzi.…
Fhourstones, the first program to solve Connect 4 (to a depth of 8 plies,) which was also crucial for animating the graphs in this video: tromp.github.io/c4/fhour.html
The first published (weak) solution to Connect 4: tromp.github.io/c4/connect4_thesis.pdf

Rendered with github.com/2swap/swaptube

A (brand new and totally undeveloped) discord server for my channel: discord.gg/EMmFwEgnTz
A nice discord community for Connect 4: discord.gg/7K9kSeHxYV

Thanks again for the tunes, Tim!

All Comments (21)
  • @sorin_markov
    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
    guess its time to watch another really well made connect 4 video i dont understand
  • @tsanguine
    "So far we've been interested in strategies of connect 4," instant sub. straight to the point. i love you.
  • @rafthesheep
    time for more "i don't remember this channel but i love past me for subscribing" content
  • @MusicBent
    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
  • @warguy6474
    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
  • @sorin_markov
    As a connect four expert, I understood about 5 of these words.
  • @twoswap
    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
  • @jay-tbl
    thinking of strategy in games as a compressed version for the actual solution is mind blowing
  • @olliebop1
    YES NEW 2SWAPPPPP I LOVE CONNECT 4 THEORY
  • @fallenflame8678
    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.
  • @SirLightfire
    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
  • @an_asp
    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!
  • @ees4.
    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!
  • It's not actually a tree, two moves each can end up at the same place if moves are transposed.
  • hard to put into words how much i love + appreciate these videos, thanks a lot for making this
  • @lit_kzh
    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!