DRAWING A PLANAR
GRAPH ON A GRID
LAST WEEK
Any planar graph has a Straight-line drawing
But it might take a lot of space
GRID
Grid point – a point with integer coordinates
m by n grid – the set of grid points (x, y) with
0≤x≤m
0≤y≤n
Map each vertex in the graph to a grid point
Goal - minimize the size of the needed grid
THEOREM
Any planar graph with n vertices has a straightline embedding on the 2n-4 by n-2 grid.
n=6:
n-2
2n - 4
PROOF
G triangulation
Exterior face of G – u v w
{v1 = u, v2 = v, v3, ... , vn = w} canonical labeling of the
vertices of G
Gk – the sub-graph of G induced by {v1, v2, ... , vk}
v7 = w
G:
G6 :
v5
v6
v4
v3
v1 = u
v2 = v
EACH GRAPH Gk CAN BE EMBEDDED ON
THE 2k-4 BY k-2 GRID
By induction on k, show that Gk can be
embedded on the 2k-4 by k-2 grid (k ≥ 3) :
k = 3:
2k – 4 = 2
K–2=1
2 by 1 grid
f3(v1)= (0, 0)
f3(v3)= (1, 1)
f3(v2)= (2, 0)
INDUCTION HYPOTHESIS
Assume we already found
fk-1(vi) = (xk-1(vi), yk-1(vi))
(1 ≤ i ≤ k-1), (4 ≤ k)
Where
fk-1(v1) = (0, 0), fk-1(v2) = (2k – 6, 0)
Exterior face monotonic in x (cyclic order)
The segments fk-1(ui) , fk-1(ui+1) all have slopes +1
or -1
u3
K = 7, k-1 = 6:
2k – 4 = 10
K–2=5
10 by 5 grid
u5
u4
u2
u1
fk-1(v1)= (0, 0)
u5
u6
fk-1(v2)= (2k – 6, 0)
SHOW FOR k
We’d like to define fk(vk)
(draw vk)
{up, up+1, ... , uq} the neighbors of vk in Gk
Good Candidate – P(up, uq)
P(u3, u5)
u3
vk’s neighbors in Gk are {u3, u4, u5}
u5
u4
u2
u1
f6(v1)= (0, 0)
We might have a problem...
u6
f6(v2)= (8, 0)
PROBLEM
Assume vk’s neighbors in Gk are {u2, u3, u4, u5}
How do we connect vk to u2 with a straight line?
P(u2, u5)
u3
u5
u4
u2
u1
f6(v1)= (0, 0)
u6
f6(v2)= (8, 0)
MODIFY THE PREVIOUS EMBEDDING
Modify fk-1 first
Move fk-1(ui) where p+1 ≤ i ≤ q-1 one unit to the right
Move fk-1(uj) where q ≤ j ≤ m two units to the right
vk’s neighbors in Gk :
{u2, u3, u4, u5}
P(u2, u5)
u3
u5
u4
u2
u1
f6(v1)= (0, 0)
u6
f6(v2)= (8, 0)
ANOTHER PROBLEM
What about the interior vertices?
Insert v8 with neighbors {u2, u3, u4, u5} in G8:
v7 = u3
u45
v4 = u2
v1 = u1
v6 = u3
v5 = u4
v2 = u65
DEFINE A NEW ORDER
Define a total order “‹” on {v1, v2, ... , vn}
recursively:
v1 ‹ v3 ‹ v2
Assume the order has already been defined for
{v1, v2, ... , vk-1}
{up, up+1, ... , uq} the neighbors of vk in Gk
Insert vk just before up+1
f3(v3)= (1, 1)
f3(v1)= (0, 0)
f3(v2)= (2, 0)
EXAMPLE
In our example:
v7’s Neighbors in G7 = {u2, u3, u4, u5}
v7
u5
v4 = u2
v1 = u1
v6 = u3
v5 = u4
v2 = u6
v7 ‹
... ‹ v4 (u ) ‹ v6 (u ) ‹ ...
2
3
SOLUTION CONTINUED
Now modifing fk-1 will be defined as
Move fk-1(ui) where up+1 ‹ = ui ‹ uq-1 one unit to the right
Move fk-1(uj) where uq ‹ = uj ‹ = um two units to the
right
Insert v8 with neighbors {u2, u3, u4, u5} in G8:
v7 = u3
u4
v4 = u2
v1 = u1
v6
v5
... ‹ v4 ‹ v7 ‹ v6 ‹ ...
v2 = u5
PROVE fk IS A STRAIGHT LINE EMBEDDING
Assume that fk-1 is a straight line embedding of
Gk-1
fk-1(vi)= (xk-1(vi), yk-1(vi))
α1, α2, ... ,αm ≥ 0
For any 1 ≤ i ≤ k-1 , 1 ≤ j ≤ m:
x(vi) = xk-1(vi) + α1 + α2 + ... + αj if uj ‹ = vi ‹ uj+1
y(vi) = yk-1(vi)
Then f ’ k-1 = (x, y) is also a straight line
embedding of Gk-1
INDUCTION BASE
k = 4:
α1, α2, α3, α4
v1 ‹ v4 ‹ v3 ‹ v2
x(v1) = xk-1(v1) + α1 , since u1 ‹ = v1 ‹ u2
x(v4) = xk-1(v4) + α1 + α2 , since u1 ‹ = v4 ‹ u2 ,u2 ‹ = v4 ‹ u3
x(v3) = xk-1(v3) + α1 + α2 + α3
x(v2) = xk-1(v2) + α1 + α2 + α3 + α4
v4 = u2
v3
v1 = u1
v2 = u3
SHOW FOR Gk
u1, ... , up, vk, uq, ... , um – the exterior face of Gk
Fix α(u1), α(u2), ... , α(up), α(vk), α(uq), ... , α(um)
Take Gk-1, and α1 = α(u1), ... , αp = α(up),
αp+1 = α(vk) + 1, αp+2 = 0, ... , αq = α(uq) + 1,
αq+1 = α(uq+1), ... , αm = α(um)
Apply the induction hypothesis – the restriction
of f ’k to Gk-1 is a straight line embedding.
Also vk’s edges don’t create any crossing
Questions?
© Copyright 2026 Paperzz