8 Maze Generating Algorithms in 3 Minutes

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ย. 2024
  • Personal favourites maze generating algorithms implemented by python module pygame: DFS, Randomized Prim's, Eller's, Hunt-and-Kill, Binary Tree, Randomized Kruskal's, Sidewinder and Aldous-Broder algorithm.
    All of these algorithms create "perfect" mazes. This means that between two arbitrary points from any maze, there is exactly one path connecting them.
    Background Music by Unicorn Heads: A New Orleans Crawfish Boil
    Credits for the information on the algorithms:
    weblog.jamisbu...

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

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

    ---Time Stamps for all Algorithms--
    Depth first search 0:16
    Randomized Prim's Algorithm 0:33
    Eller's Algorithm 0:49
    Hunt-and-kill Algorithm 1:06
    Binary Tree Algorithm 1:23
    Randomized Kruskal's Algorithm 1:39
    Sidewinder Algorithm 1:56
    Aldous-Broder Algorithm 2:12

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

    Thank you for this video. It is incredibly useful, and seeing the visualization alongside the description is helpful. If there was a "useful information density" award, you deserve it.

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

    But can it generate the path to the maze of your heart?

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

    Possibly the best enumeration video. No small talks, and goes immediately to the point!

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

    This was so satisfying to watch man, keep up the good work!

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

    This is the best formatted video i've seen

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

    This is strangely relaxing!! Excellent job

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

    My algorithm ("Maze Creator") is closest to the Depth First Search. It stores a number in each cell visited, giving it a 1, 2, 3, or 4 depending on what direction it moves to from there (North, East, South, and West). If a dead end is reached, any square it backtracks from is marked with a "5". These are all "guide numbers". Each cell contains one 8-bit number, and the guide number is stored in the fourth, fifth, and sixth bit of the cell's contents. The seventh and eighth bits contain "path data", where the seventh bit tells if the south path is open, while the eighth bit tells if the east path is open (To see if the west path is open, you have to check the data from the cell to west, while the cell to the north will tell you if the north path is open).

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

    This video was so good I immediately subscribed! But where's Wilson's algorithm? It generates an unbiased sample from the uniform distribution over all mazes, using loop-erased random walks, not favouring either long corridors (like DFS) nor many short dead ends (like Kruskal's and Prim's algorithms). It should be included here.

  • @crayder1100
    @crayder1100 2 ปีที่แล้ว +9

    I've been playing around with applying randomness to depth-first. During generation steps I simply give chances to do the following instead of normal depth-first'ing; jump to random unvisited cell anywhere near the path and branch from there (many more branches this way, interestingly long ones), randomly backtrack a few spaces and branch from there (again more branches but smaller ones), or randomly allow the depth-first phase then go back to the previous cell (even more branches, but this makes single and double node dead-ends more often which is fantastic for my game). Each of these three values can be adjusted and produce much better results than normal depth first.
    EDIT: TLDR* normal depth-first normally ends up generating a long path with very few branches to get lost in. Mine eliminates the latter.

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

      I've tried that, too :D I also like to allow some paths to extend longer in a certain direction. To me it makes the paths look more like mazes in real life, where you kind of have long hallways instead of having corners every 1 - 2 cells. It's more refreshing if you walk through the maze. I used that for a minecraft maze generator if that makes more sense.

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

      @@klauspeter2199 ​ I made it in JS as well so you can test it out here: (link removed because TH-cam keeps deleting my comment... not sure how to share it.)
      You can see what the fields at the top are by clicking on them. But it's Width, Height, Random Branch Chance, and Random Stasis Chance. Branch chance make branches more likely and Stasis makes the map generate around where it is currently more often. These are important for what I was explaining above.
      Also if you click Calculate then Path it'll show you the longest possible path.

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

      ​@@klauspeter2199 (ht$tp @s : / / jsf $iddl@ e$.@net/Cr@ ay $d eh/8$07 n$w 6z $ f/ @ 31/sh o @$ w) (remove spaces, @, and $ symbols, TH-cam keeps deleting my comment with the link in it)

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

      @@klauspeter2199 Yes, all those spaces and symbols were necessary and THAT'S F**KING STUPID, @Google.

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

      @@crayder1100 is it available on your github?

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

    Nice visual explanation of the algorithms

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

    This is super interesting i gotta stay tuned.

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

    This is something new! be waiting for more!

  • @black-kv5ly
    @black-kv5ly ปีที่แล้ว

    This video is what I want to see. very good!!!💯💯💯

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

    This was very helpful

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

    Is there a specific algorithm that forms a maze from a selected finnish & end ? (Within a boundry)???

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

      i think the best way would be to generate the maze then carve a path

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

      @@todo1553 cheers

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

    so cool, thanks!

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

    Any algorithm with excessive amounts of hallways a single cell long should not count as a maze. When you can clearly see it's a dead end, it's no longer a puzzle to solve. It's just a bunch of space filler. You might as well just seal those passages off and have a single path through the whole thing.
    You know you're a nerd when you start gatekeeping what counts as a valid maze algorithm.

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

    Love this

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

    very satisfying!!!!

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

    1:46 isnt it wave function collapse?

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

    Awesome 🔥🔥

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

    This is so memorizing! 👀

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

      I think you mean mesmerising

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

    nice video!

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

    Cool vid 😁

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

    how do i git at that repo...

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

    So interesting! 🧠

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

    nice video :)

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

    nice

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

    where is the github link?

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

    Wanted a tutorial.

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

    nice