planar_layout#
- graph_tool.draw.planar_layout(g, pos=None)[source]#
Performs a canonical layout of a planar graph.
- Parameters:
- g
Graph
Planar graph to be used.
- pos
VertexPropertyMap
(optional, default:None
) Vector vertex property maps where the coordinates should be stored.
- g
- Returns:
- pos
VertexPropertyMap
A vector-valued vertex property map with the coordinates of the vertices.
- pos
Notes
This algorithm has complexity \(O(V + E)\).
References
[straight-line-boost]http://www.boost.org/doc/libs/release/libs/graph/doc/straight_line_drawing.html
[chrobak-linear-1995]M. Chrobak, T. Payne, “A Linear-time Algorithm for Drawing a Planar Graph on the Grid”, Information Processing Letters 54: 241-246, (1995), DOI: 10.1016/0020-0190(95)00020-D [sci-hub, @tor]
Examples
>>> g = gt.lattice([10, 10]) >>> pos = gt.planar_layout(g) >>> gt.graph_draw(g, pos=pos, output="lattice-planar.pdf") <...>