Hacker News new | ask | show | jobs
by TophWells 4411 days ago
>I wonder if this works backwards - given a tree could you construct a maze? efficiently?

There are trees for which no rectangular maze exists - for example, any tree with a vertex of degree greater than 4. Or the tree with 4 vertices arranged in a T, which can't be fit into a 2x2 space. If there is such an algorithm, it'll have to account for the possibility that there is no solution, so I wouldn't expect it to be very efficient.