0

I'm trying to code an algorithm to get the faces of an undirected graph. The graph I receive in the input is known to be planar and biconnected. However, the graph's adjacency list isn't ordered in any way (clockwise or counterclockwise).

I have done some research on the subject and some StackOverflow threads suggest to do a planar embedding of the graph. I have found this article: Efficient Planarity Testing, written by Tarjan and Hopcroft. This article describes the edge-addition algorithm.

On the other hand, I find the code quite laborious just to verify the planarity of a graph. I don't want to draw the graph, I don't care if there are many embeddings, I just want to list the faces of my graph. To do so, I need a way to order my edges. However the article doesn't specify any clockwise ordering per se, but it does show a subprocess whose job is to order the edge (Section 5, p. 8), it doesn't seem to order in clockwise, but by their LOWPT values.

My question is: is there any algorithm to sort my edge or do I have to produce a planar embedding of a graph, which I already know is planar and biconnected?

Thank you

LVB
  • 312
  • 3
  • 13
  • Ordering of the vertices in the faces doesn't have any meaning except in the context of a specific embedding of a graph. As a trivial example, a clockwise ordering will become counter-clockwise if you reflect the embedding. Any of the faces can be chosen to be the perimeter of a new embedding of the graph, which will change the direction of some faces and leave others untouched, and create a new face from the cycle formed by the previous perimeter. – beaker May 16 '19 at 19:13
  • @beaker I want to have an ordering so that I can traverse my graph and find all my faces. I don't really get your point. – LVB May 16 '19 at 19:16
  • If you're simply looking for the vertices that make up the faces, that's just cycle detection. If you want a consistent ordering, that's dependent on an embedding. – beaker May 16 '19 at 19:23
  • @beaker Yea you are right, I thought detecting shortest cycle that covers every vertex could be expensive. I was looking for something like [PlanarGraph](http://hackage.haskell.org/package/planar-graph-1.0.0.0/docs/Data-Graph-Planar.html) in Haskell where the function _getFaces_ traverse the graph in clockwise to find all the faces, without doing any cycle detection. – LVB May 16 '19 at 19:28
  • @beaker if you look at this [problem](https://math.stackexchange.com/questions/8140/find-all-cycles-faces-in-a-graph), with cycle detection, the problem is not to count cycles that contains shorter cycles in it. In this post, it requires a planar embedding. – LVB May 16 '19 at 19:32

0 Answers0