Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ah yes, thinking of it as the union of planar subgraphs does make the structure of the problem much clearer. Seems obvious now, but thank you for the tip