135 points · by eigenvalue · 2y ago · 38 comments
Then it turned out that many of the generated mazes weren't actually solvable, so I spent some time coming up with various strategies to test and validate the generated mazes and then modify them so they would work better for this purpose. I spent a fair amount of effort trying to optimize the performance as much as possible using tools like Numba where applicable, but I also got tired of the code bringing my very powerful machine to its knees. So, I tried to make it play nice with the rest of the system while also saturating a big computer with tons of CPU cores. This was done using concurrent futures with some tweaks, like using a Semaphore and lowering the CPU priority. People might find this project interesting just for these performance-tuning features.
I also spent a lot of time trying to make beautiful-looking animations that show multiple randomly generated mazes side by side, where you can see A* "races" as it tries to solve all the mazes at the same time, showing the current progress. When a solution is found, it is traced out on the screen. It's actually not that easy to get really slick/beautiful looking results straight out of Matplotlib, but if you use custom fonts and tweak a lot of parameters, it starts to look pretty polished.
Now you can just run this on a spare Linux machine and come back in a few hours to have a bunch of cool-looking animations to check out. By changing the grid sizes, you can get very different-looking effects, although larger grids can take a lot of compute power to render. Anyway, I hope you guys like it! I'm happy to answer any questions. I'm sure there are still some bugs, but it has been running pretty well for me and generating lots of cool-looking animations. Note: I know that the pulsating title at the top in the demo video is annoying— I already slowed this way down in the code but didn't want to wait for it to regenerate the video.
Also, here's the Lisp implementation post that inspired me (and which I based my Python code on):
https://news.ycombinator.com/item?id=41145528
And here are a few other sample videos using different settings-- I'll add more during the day as they finish generating:
https://www.dropbox.com/scl/fo/q13cxuvgy8vxr3ksi06uw/APkL57-...
LoL.
I guess that for your intention, using an inconsistent heuristic that over-estimated costs and resulted in sub-optimal solutions was fine because you wanted sub-optimal solutions in your penalty-free problem, but this was better modeled by a modified problem that either penalized or forbid certain solutions in the original problem.
Hacking only the heuristic side will seem to work as intended on short paths, but as the f-value (g+h) naturally starts being dominated by g as the solutions become longer, you'll see that the hints at what not to do embedded in the heuristic will start to seemingly become neglected by A*
---
They talk about the use of the pneumatic vine robots to nav rubble and caves etc - but if the vine robot could evaluate the terrain and use apropriate routing algo based on the nature of the terrain it was doing. they arent using vision necessarily in the vine robots - but if they could use terrain sensors that informed the best routing algo to use/accomplish goal that would be neat.
Another interesting thing about this would be to apply it to where vine-style micro-trenchers could know the patter of the lattice that will best be needed to accomplish whatever the stated newton bracing requirement were - then you could plop relative light foot pads onto a celestial body - then have these vine into the surface in such a way where you can begin to attach larger objects and very easily build foundations to large space structures - plus, as it maps out - you have an exact map of what your mycelium -like base foundation look like.
EDIT:
And you could grow the foundation as need - however, imagine a series of tubes mabe by these vinind robotw - that are later filled in (the robots) with structural hardening material -- you vine your robots into the mountian in sequences - first do a large outer lattice - and strucurally brace it with whatever material - then in the center space - vine into the core and fill those with explosives and tunnel. -- then you can snake through your exploded rubble - see whatst up - and deliver cables and hoses through the vine to a forward location...
A vine robot that tunnels - but its outer layer is a permiable filter and it has capillary features - but basically it unfulrs into being a well and the outer material is expanded do to corrugations in the design allowing debris filteres water to create a layer around the new pipe - and then capillaried up - or a pump in the core at the head of the water-wyrm.
(I need to figure out how to make some of these -- I love them.)
Somehow make it so that the top ~70% of next steps in the queue are never the next step in the solution (I'm too tired right now to come up with any sort of answer, but my guess is that it wouldn't be possible to generate a planar maze that way).
Really fun to watch.
Heh, and here I sit, usually complaining about the opposite!
"Don't make it so OOP gratuitous so it gets a bit easier to read and understand" is probably something I've said more than twice.
Guess what's readable or not is subjective :)
In any case, this project is about making cool looking and educational animations of a pathfinding algorithm and generating interesting and diverse mazes to test it on. Not about making some amazing and modular reusable system.
Edit: I'm curious about other repositories under your account also. For example, this one:
https://github.com/Dicklesworthstone/introduction_to_tempora...
The content of this repo is an essay on temporal logic that seems at once unnecessarily verbose and lacking in concrete information (e.g. lists of "logical operators" -i.e. logical connectives and quantifiers- and their examples but nothing about logical interpretations, in an essay about proofs). If that's the case, then I'm curious what is the motivation of having that on github. If I were really paranoid I'd think you're trying to hasten self-training model collapse :)
Same with the README. It's the result of tons of manual intervention, many many steps of iteratively revising and changing, adding sections, improving sections, etc., and it's ultimately driven by the code itself which it is describing. The people who think it's so easy should try themselves and see if they can make anything that anyone thinks is cool or interesting with one or two LLM prompts.
Also because I've done some recent work on generating and solving mazes, and other grid-based maps, with a form of symbolic learning and I wanted to link to it, in case you (or someone else) are interested:
https://github.com/stassa/ijclr_2024_experiments/tree/master
When I was writing that paper I was looking for a quick way to generate grid-based maps of different kinds, not just mazes, so I would have been interested in your project. I might be able to use it in the future, if I do more work on mazes.
Edit: um, sorry for the harsh criticism of the temporal logic essay. I do think it needs more concise language, and more formality too.
As for the temporal logic essay, you're very welcome to fork it and submit a PR to make something more formal/correct, but keep in mind that my goal with that was more explaining things in an intuitive way-- there are plenty of rigorous but impenetrable tomes already about mathematical logic!