Wrapper for Boyer’s (C) planarity algorithm¶
- sage.graphs.planarity.is_planar(g, kuratowski=False, set_pos=False, set_embedding=False)[source]¶
- Check whether - gis planar using Boyer’s planarity algorithm.- If - kuratowskiis- False, returns- Trueif- gis planar,- Falseotherwise. If- kuratowskiis- True, returns a tuple, first entry is a boolean (whether or not the graph is planar) and second entry is a Kuratowski subgraph, i.e. an edge subdivision of \(K_5\) or \(K_{3,3}\) (if not planar) or- None(if planar). Also, will set an- _embeddingattribute for the graph- gif- set_embeddingis set to- True.- INPUT: - kuratowski– boolean (default:- False); when set to- True, return a tuple of a boolean and either- Noneor a Kuratowski subgraph (i.e. an edge subdivision of \(K_5\) or \(K_{3,3}\)). When set to- False, returns- Trueif- gis planar,- Falseotherwise.
- set_pos– boolean (default:- False); whether to use Schnyder’s algorithm to determine and set positions
- set_embedding– boolean (default:- False); whether to record the combinatorial embedding returned (see- get_embedding())
 - EXAMPLES: - sage: G = graphs.DodecahedralGraph() sage: from sage.graphs.planarity import is_planar sage: is_planar(G) True sage: Graph('@').is_planar() True - >>> from sage.all import * >>> G = graphs.DodecahedralGraph() >>> from sage.graphs.planarity import is_planar >>> is_planar(G) True >>> Graph('@').is_planar() True