Algorithm for disc representation for a planar graph
An outline
-
Input: a drawing of a planar graph in the plane
-
Outline of an algorithm for computing the radius of discs associated with vertices
-
Triangulate the planar drawing by adding edges if necessary.
The resulting drawing has all faces being triangles.
-
Assign weight 1/2 to each vertex, i.e.,
set
ri = 1/2
for each vertex
vi.
-
Compute, for each interior vertex
vi, the sum
si of angles at
vi
in faces incident to
vi.
Hint: For a triangle of three sides a, b, c with angles t between a and b, the formula to
determine t is
cos t = (a2 +
b2 -
c2)/(2 a b)
Hint: For a vertex incident to the outerface, extra care should be given
for incident
angles.
-
If, for all i,
| si - 2 π | < 0.0001,
stop and we have our
ri.
(Here π = pi = 180 degrees.)
If, for some i,
si < 2 π - 0.0001,
set
new ri =
old ri - 0.0001
and the three vertices, say,
v1,
v2,
v3,
incident to the outerface, with
new r1 =
new r2 =
new r3 =
old r1 + 0.0001/3
Repeat Step 2.
-
Layout the disc representation using
ri.