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:
Does anyone see an issue with this? Will it even work?
The key idea is that a shortest cycle is comprised of a shortest path between two vertices, say v and w, that does not include edge v-w, plus the edge v-w. We can find the shortest such path by deleting v-w from the graph and running breadth-first search from v (or w).
Because every 4-connected planar graph contains a triangle (by Euler's formula), Corollary 2.8 implies that if G is a 4-connected planar graph on n≥6 vertices, then G has a cycle of length n−3.
There is a cycle in a graph only if there is a back edge present in the graph. Depth First Traversal can be used to detect a cycle in a Graph, DFS for a connected graph produces a tree. If the graph is disconnected then get the DFS forest and check for a cycle in individual trees by checking back edges.
A simple cycle is a cycle in a Graph with no repeated vertices (except for the beginning and ending vertex). Basically, if a cycle can't be broken down to two or more cycles, then it is a simple cycle.
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.
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With