Sorry for bad English. It's somehow called Minimal Cycle Basis of graph algorithm. 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.
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.
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.
Is there any cheap solution on this one? I'm currently quick trapped.