The tricky task of label placement could be outsourced to a SAT solver.
The way it works is that for every city, town etc you generate a few placement candidates (4 positions around the point like you do seems fine) and then calculate all the pairs of placements that collide. For each collision you add a clause to a SAT formula that forbids this combination from occurring. Every solution of this formula will be a clean labeling of your map.
I think you underestimate how hard the original problem is. Small decisions can cascade and have effects very far away on the map. Also, in what exact sense do you mean convex?
Furthermore, SAT is hard in theory but the kind of very structured instances found in practice tend to respond well to heuristics.
Reminds me of a bit in one of Neal Stephenson's books where a MMORPG company hired a team of geologists to generate a geologically plausible map for their game. The hardest part of their job was finding ways to integrate the parts of the world that had been made up without any regard geology and made no sense in their model.
A cool part was one of the engineers complaining when a powerful user cast a spell that deformed the landscape. The whole world was a huge finite element simulation so that one spell cause CPU usage to spike as whole world had to be updated. The book was fun, sort of a thriller, but I felt Stephenson could have done more exploring the world of the MMO game. A rare complaint for him.
Cast in another light, it was standard Stephenson fare -- the first half of the book explores a topic deeply and interestingly, then the second half basically sets it aside to trail off into some weird no-man's land. Seveneves was particularly obvious version of this issue.
I thought Seveneves was more like two "first half of Stephenson novels" smushed together; I found myself wishing there was more exploration of the "second" world. I thought the cultural evolution stuff was super interesting.
BTW, this is a quick way to generate an higher resolution map on the site. Open the developer tools, remove the width from .note (it's the container of the column), inspect the map at the bottom and set the height and width of the canvas to suit your needs. Then click on the Generate button. Maybe the page could be changed to extract that canvas from the column layout and make it fit the viewport.
Comments (64) 36 threads
Earlier commentsThe way it works is that for every city, town etc you generate a few placement candidates (4 positions around the point like you do seems fine) and then calculate all the pairs of placements that collide. For each collision you add a clause to a SAT formula that forbids this combination from occurring. Every solution of this formula will be a clean labeling of your map.
Furthermore, SAT is hard in theory but the kind of very structured instances found in practice tend to respond well to heuristics.
A cool part was one of the engineers complaining when a powerful user cast a spell that deformed the landscape. The whole world was a huge finite element simulation so that one spell cause CPU usage to spike as whole world had to be updated.
The book was fun, sort of a thriller, but I felt Stephenson could have done more exploring the world of the MMO game. A rare complaint for him.
BTW, this is a quick way to generate an higher resolution map on the site. Open the developer tools, remove the width from .note (it's the container of the column), inspect the map at the bottom and set the height and width of the canvas to suit your needs. Then click on the Generate button.
Maybe the page could be changed to extract that canvas from the column layout and make it fit the viewport.
EDIT -
Oooo and it's MIT...
All comments shown.
Couldn't load more comments. Check your connection and try again.