Graph embedding algorithm is based on one of a graph planarity testing which described in the book "Graph Drawing. Algorithms for the Visualization of Graphs". Its authors are Giuseppe Di Battista, Peter Eades, Roberto Tamassia and Ioannis G. Tollis.
- embedGraph :: Gr a b -> Gr a Int
- embedDiGraph :: Gr a b -> Gr a (Int, Int)
Documentation
embedGraph :: Gr a b -> Gr a IntSource
The embedGraph
function embeds a planar biconnected undirected graph into a plane.
Edge's label of an embedded graph is a position of the edge in its source node.
In undirected graph each edge is presented a pair of directed edges. Therefore it's enough each edge keeps only its position in the source node.
embedDiGraph :: Gr a b -> Gr a (Int, Int)Source
The embedDiGraph
function embeds a planar directed graph into a plane. The source graph
must be biconnected if throw off edges' directions and also any two nodes v and w can have
either edge (v,w) or (w,v) but not both.
Edge's label of an embedded graph consists of a pair integers. First element is a position of the edge in its source node and second one is a position of the edge in its destination node.