Sorry for bad English.
I’m currently working on some algorithm to seperate a graph into rooms. Like the example.
I have a graph link like the one in left, I want to tell there are 2 rooms in the graph, like the red area and the orange area in the right.(https://i.sstatic.net/AJz3FU58.png)
So far, I’ve tried to walk the shortest path from an edge, which failed. Like, in the left image, I started from the edge marked red, the shortest path would be like the right image.
(https://i.sstatic.net/M6lfzR1p.png)
I’ve also tried to always take the turn with largest angle in clockwise. If it work in one graph, it would failed when starting with opposite direction.
(https://i.sstatic.net/YjzHNR8x.png)
Is there any cheap solution on this one? I’m currently quick trapped.