Walter Didimo, Giuseppe Liotta and Maurizio Patrignani. On the

On the Complexity of HV-Rectilinear
Planarity Testing
Walter Didimo, Giuseppe Liotta,
Maurizio Patrignani
Perugia University
Roma Tre University
Graph Drawing, 2014, Würzburg – M. Patrignani
HV-graphs and HV-drawings
 An HV-graph
7
7
V
H
1
H
8
V
5
V
H
6
8
4
V
V
H
H
3
5
V
2
H
V
3
6
H
V
2
V
H
1
V
4
 An HV-drawing of it
Graph Drawing, 2014, Würzburg – M. Patrignani
HV-rectilinear planarity testing
 A positive instance
9
V
8
V
6
H
V
5
V
10
V
14
12
H
H
15
H
4
2
V
1
H
12
13
9
V
H
H
11
V
H
V
10
H
V
8
V
6
V
H
2
1
H
4
V
V
V
H
15
13
11
H
H
V
H
H
7
14
H
V
5
V
H
3
3
An HV-graph
An HV-drawing of it
Graph Drawing, 2014, Würzburg – M. Patrignani
7
HV-rectilinear planarity testing
 A negative instance
9
H
1
V
4
H
V
H
3
11
H
V
V
V
14
H
2
H
5
H
V
H
14
V
H
7
H
V
10
V
H
11
15
H
V
V
6
2
8
H
6
10
H
7
13
H
4
V
9
13
12
15
V
V
V
3
V
1
V
H
H
V
V
5
H
8
12
V
An HV-graph
No HV-drawing can be
found
Graph Drawing, 2014, Würzburg – M. Patrignani
Rectilinear drawings
 The HV-rectilinear planarity testing
is a constrained case of rectilinear
planarity testing
 In a rectilinear orthogonal drawing
each edge is a horizontal or vertical
segment and edges do not cross
9
11
10
6
8
7
4
3
5
2
1
Graph Drawing, 2014, Würzburg – M. Patrignani
12
Rectilinear planarity testing
 Fixed embedding setting
 Polynomial O(n2 log n)
[Tamassia, 87]
 Improved to O(n3/2)
[Cornelsen, Karrenbauer, 12]
 Linear for maximum degree three
[Rahman, Nishizeki, Naznin, 03]
 Variable embedding setting
 NP-complete
[Garg, Tamassia, 01]
 Polynomial for biconnected series-parallel graphs and 3planar graphs
[Di Battista, Liotta, Vargiu, 98]
 Polynomial for series-parallel graphs of maximum
degree three
[Zhou, Nishizeki, 08]
Graph Drawing, 2014, Würzburg – M. Patrignani
Constrained rectilinear planarity
 “Left”, “Right”, “Up”, “Down” labeling
 Polynomial O(n2)
[Vijayan, Wigderson, 85]
 Improved to linear
[Hoffmann, Kriegel, 88]
 Polynomial when crossings admitted
[Maňuch, Patterson, Poon, Thachuk, 10]
 3D version (“Up”, “Down”, “Left”,
“Right”, “Front”, “Back” labels)
[Di Battista, Liotta, Lubiw, Whitesides, 02]
[Di Giacomo, Liotta, Patrignani, 04]
[Di Battista, Kim, Liotta, Lubiw, Whitesides, 12]
Graph Drawing, 2014, Würzburg – M. Patrignani
HV-rectilinear planarity testing
 Fixed embedding setting
 Polynomial
[Durocher, Felsner, Mehrabi, Mondal, 14]
 Variable embedding setting
 Polynomial for biconnected outerplanar
graphs with vertex-degree at most three
[Durocher, Felsner, Mehrabi, Mondal, 14]
 NP-hard when crossings admitted
[Maňuch, Patterson, Poon, Thachuk, 10]
Graph Drawing, 2014, Würzburg – M. Patrignani
HV-rectilinear planarity testing
 Questions
 What is the complexity of HV-rectilinear
planarity testing in the variable
embedding setting?
[Maňuch, Patterson, Poon, Thachuk, 10]
[Durocher, Felsner, Mehrabi, Mondal, 14]
 What is the class of HV-outerplanar
graphs that admit HV-drawings?
[Durocher, Felsner, Mehrabi, Mondal, 14]
Graph Drawing, 2014, Würzburg – M. Patrignani
Our results
 HV-rectilinear planarity testing is
NP-complete in the variable
embedding setting
 even for HV-graphs with vertex-degree
at most three
 There exists a polynomial-time
algorithm to recognize whether a
series-parallel HV-graph admits an
HV-drawing
 extended to partial 2-trees
Graph Drawing, 2014, Würzburg – M. Patrignani
Our results
 HV-rectilinear planarity testing is
NP-complete in the variable
embedding setting
 even for HV-graphs with vertex-degree
at most three
 There exists a polynomial-time
algorithm to recognize whether a
series-parallel HV-graph admits an
HV-drawing
 extended to partial 2-trees
Graph Drawing, 2014, Würzburg – M. Patrignani
Spirality
 Spirality is a measure of how much a
path is “rolled up”
 you need spirality 4
to close a cycle
clockwise
+1
+2
+1 +2
+1
+4
+3
+4
+1
+2
+3
+1
+2
-2
-3
+2
0
+1
+4
Graph Drawing, 2014, Würzburg – M. Patrignani
-1
-2
-1
0
+3
Switch-flow networks
 A switch-flow network
is a graph where each
edge is labeled
with a capacity
range [c′...c′′]
[1]
of nonnegative
G
integers
 For simplicity, the
capacity range [c...c]
is denoted with [c]
[0]
E
[0]
[1]
[1]
F
D
[0]
B
[1]
[1]
[0..2]
[1]
A
Graph Drawing, 2014, Würzburg – M. Patrignani
[0]
[1]
C
Switch-flow networks and flows
 A flow is an orientation
of the edges and an
assignment of
integer values
to them so that
 Each value is
within the capacity G
range of the edge
 The incoming and
outgoing flows are
balanced at each vertex
[0]
E
[0]
[1]
[1]
F
D
[0]
B
[1]
[1]
[1]
[0..2]
[1]
A
Graph Drawing, 2014, Würzburg – M. Patrignani
[0]
[1]
C
Switch-flow network problem
Instance
 A switch-flow network N
Question
 Does N admit a flow?
 NP-complete ([Garg, Tamassia, 01])
even in the special case when
 the network is planar
 the lower bounds of the capacity ranges
are either
• zero (as in [0...c]), or
• equal to the upper bounds (as in [c])
Graph Drawing, 2014, Würzburg – M. Patrignani
1) Start from a switch-flow network
[0]
E
[0]
[1]
[1]
F
[1]
G
D
[0]
B
[1]
[1]
[0..2]
[1]
A
[0]
[1]
Graph Drawing, 2014, Würzburg – M. Patrignani
C
2) Make it maximal planar
 Dummy
edges
have all
capacity
range [0]
[0]
[0]
E
[0]
[1]
[1]
F
[1]
G
[0]
D
[0]
B
[1]
[1]
[0..2]
[1]
A
[0]
[0]
[1]
Graph Drawing, 2014, Würzburg – M. Patrignani
C
3) Compute the dual graph
 The dual
graph is
3 regular
[0]
[0]
E
[0]
[1]
[1]
F
[1]
G
[0]
D
[0]
B
[1]
[1]
[0..2]
[1]
A
[0]
[0]
[1]
Graph Drawing, 2014, Würzburg – M. Patrignani
C
3) Compute the dual graph
 The dual
graph is
3 regular
 Capacity
ranges are
transferred
[1]
to the
edges of G
the dual
[0]
[0]
E
[0]
[1]
[1]
F
[0]
D
[0]
B
[1]
[1]
[0..2]
[1]
A
[0]
[0]
[1]
Graph Drawing, 2014, Würzburg – M. Patrignani
C
4) Draw the dual orthogonally
 We use
[Tamassia,
Tollis, 89]
Graph Drawing, 2014, Würzburg – M. Patrignani
5) Transform it into a rigid frame
 Observe
that each
vertex has
maximum
degree 3
Graph Drawing, 2014, Würzburg – M. Patrignani
Tendrils represents flows
 Let one unit of flow correspond to 4
right angles
[1]
F
[1]
G
F
F G
F
G
[1]
G
F
F G
Tendril T1
G
F G
F G
Tendril T1
Graph Drawing, 2014, Würzburg – M. Patrignani
Tendrils
 Tendril Th represents h units of flow
between two faces
[1]
F
[2]
G
Tendril T1
F
[h]
G
Tendril T2
F
G
Tendril Th
Graph Drawing, 2014, Würzburg – M. Patrignani
Wiggles
 A wiggle Wc represents the flow between
two faces with capacity range [0…c]
Wiggle W2
Wiggle W1
Graph Drawing, 2014, Würzburg – M. Patrignani
Wiggle Wh
6) Produce the final instance
Graph Drawing, 2014, Würzburg – M. Patrignani
Equivalence theorem
 A flow in the original network N
corresponds to an HV-drawing of the
constructed instance and vice-versa
Graph Drawing, 2014, Würzburg – M. Patrignani
Our results
 HV-rectilinear planarity testing is
NP-complete in the variable
embedding setting
 even for HV-graphs with vertex-degree
at most three
 There exists a polynomial-time
algorithm to recognize whether a
series-parallel HV-graph admits an
HV-drawing
 extended to partial 2-trees
Graph Drawing, 2014, Würzburg – M. Patrignani
What are series-parallel graphs
 A series-parallel graph is
either
 A single edge
 The series composition of
two series-parallel graphs
 The parallel composition of
two series-parallel graphs
s
s1
t
t1
s2
t
 We consider biconnected
series-parallel graphs
 One edge, called reference
edge, is in parallel with the
rest of the graph
s
t2
s1
s2
s
t1
t2
t
Graph Drawing, 2014, Würzburg – M. Patrignani
Series-parallel graphs and SPQ∗-trees
 The decomposition tree describes the
series and parallel composition
needed to build the graph
Graph Drawing, 2014, Würzburg – M. Patrignani
Alias vertices and handles
 Detach a component from the graph
 Provide it with suitable handles
Graph Drawing, 2014, Würzburg – M. Patrignani
Complex handles
Graph Drawing, 2014, Würzburg – M. Patrignani
Replacement theorem
 Given a component, two HV-drawings of it
with the same spirality are equivalent
 You can replace one with the other and obtain
an HV-drawing of the graph
Graph Drawing, 2014, Würzburg – M. Patrignani
Tuples
 Each component can be decorated
with a set of O(n) tuples
 each tuple has a value of spirality
admitted by the component and one
realization of such spirality
Graph Drawing, 2014, Würzburg – M. Patrignani
Algorithm for series-parallel graphs
 Traverse bottom-up the SPQ*-tree with
reference edge e
 For each component compute its set of
tuples starting from the tuples of its
children
 Observe that O(n2) time is sometimes needed
 If one component has zero tuples the
instance does not admit an HV-drawing
with e as the reference edge
 Repeat with all possible reference edges
Graph Drawing, 2014, Würzburg – M. Patrignani
Main theorem
 There exists an O(n4)-time algorithm
that tests whether a biconnected
series-parallel HV-graph with n
vertices admits an HV-drawing
 if G has vertex-degree at most 3, the
time-complexity can be reduced to
O(n3 log n).
Graph Drawing, 2014, Würzburg – M. Patrignani
Extension to partial 2-trees
 A partial 2-tree is a simply connected
graph such that each biconnected
component is either a series-parallel
graph or a single edge
Graph Drawing, 2014, Würzburg – M. Patrignani
Observation
 Consider two blocks B1 and B2 of the tree
that have two cut vertices c1 and c2 that
can be joined by a path not traversing B1
and B2
 In any HV-drawing either c1 is on the
external face of B1 (B1 is HV-extrovert) or
c2 is on the external face of B2 (B2 is HVextrovert)
c1
c2
B1
B2
Graph Drawing, 2014, Würzburg – M. Patrignani
Algorithm for partial 2-trees
 Recursively remove HV-extrovert leaf
blocks until one of the following
occurs
 T becomes empty: the test is positive
 two blocks that are not HV-extrovert are
found: in this case the test is negative
 T consists of just one block-node B
marked as not HV-extrovert
• in this case we check whether B admits an
HV-drawing trying all its edges as reference
edges
Graph Drawing, 2014, Würzburg – M. Patrignani
Open problems
 Can the O(n4) polynomial bound for
series-parallel graphs be improved?
 for comparison, (unrestricted)
rectilinear planarity testing of seriesparallel graphs with vertex-degree at
most three is linear
[Zhou, Nishizeki, 08]
 Find a combinatorial characterization
for the HV-graphs that admit an HVdrawing
 e.g. in terms of forbidden substructures
Graph Drawing, 2014, Würzburg – M. Patrignani
Thanks!
Graph Drawing, 2014, Würzburg – M. Patrignani