All faces of a planar graph

asked 1 year ago

bobby.mir gravatar image

Is there any method to get all faces of a planar graph?

Preview: (hide)

Comments

Check method faces

sage: G = graphs.Grid2dGraph(3, 3)
sage: G.faces()
[[((0, 0), (0, 1)),
  ((0, 1), (0, 2)),
  ((0, 2), (1, 2)),
  ((1, 2), (2, 2)),
  ((2, 2), (2, 1)),
  ((2, 1), (2, 0)),
  ((2, 0), (1, 0)),
  ((1, 0), (0, 0))],
 [((0, 0), (1, 0)), ((1, 0), (1, 1)), ((1, 1), (0, 1)), ((0, 1), (0, 0))],
 [((0, 1), (1, 1)), ((1, 1), (1, 2)), ((1, 2), (0, 2)), ((0, 2), (0, 1))],
 [((1, 0), (2, 0)), ((2, 0), (2, 1)), ((2, 1), (1, 1)), ((1, 1), (1, 0))],
 [((1, 1), (2, 1)), ((2, 1), (2, 2)), ((2, 2), (1, 2)), ((1, 2), (1, 1))]]
David Coudert gravatar imageDavid Coudert ( 1 year ago )

How can I get the embedding? so how does the faces() work?

bobby.mir gravatar imagebobby.mir ( 1 year ago )

Run G.is_planar(set_embedding=True) followed by G.get_embedding().

John Palmieri gravatar imageJohn Palmieri ( 1 year ago )