What you ask for is an unsolvable problem, because it depends on the embedding of the graph in the plane (or space). Call 1234 the vertices of a square (in this order) and 5 its center. Take the graph with edges 12, 23, 34, 41, 15, 53. In this case, the "faces" are 1435 and 1532. But this graph is isomorphic to the one that you get by swapping 2 and 5, and the answer is different in this case.
Federico Poloni
- 20.2k
- 2
- 82
- 120