Say you want a simple maze on an N by M grid, with one path through, and a good number of dead ends, but that looks \"right\" (i.e. like someone made it by hand without too
My favorite way is to use Kruskal's algorithm, but when randomly choosing and edge to remove, weight the choice based on the types of edges it's connected to.
By varying the weights for different edge types, you can generate mazes with lots of distinct characteristics or "personalities". See my example here:
https://mtimmerm.github.io/webStuff/maze.html