I have a geometric undirected planar graph, that is a graph where each node has a location and no 2 edges cross, and I want to find all cycles that have no edges crossing them.
Are there any good solutions known to this problem?
What I'm planning on doing is a sort of A*
like solution:
- insert every edge in a min heap as a path
- extend the shortest path with every option
- cull paths that loop back to other than there start (might not be needed)
- cull paths that would be the third to use ang given edge
Does anyone see an issue with this? Will it even work?
A "crossing edge", as you call it, is generally known as a chord. Thus, your problem is to find all chordless cycles.
This paper looks like it may help.
A simple way to do this is to simply go out and enumerate each face. The principle is simple:
Walking the tile is performed by:
I hope this made sense; it perhaps needs some diagrams to explain...
My first instinct is to use a method similar to a wall following maze solver. Essentially, follow edges, and always take the rightmost edge out of a vertex. Any cycles you encounter with this method will be boundaries of a face. You'll have to keep track of which edges you've traversed in which direction. Once you've traversed an edge in both directions, you've identified the faces it separates. Once all edges have been traversed in both directions, you'll have identified all faces by their boundaries.