Journal of Graph Algorithms and Applications Rook-drawings of Plane Graphs

We introduce a new type of graph drawing called " rook-drawing ". A rook-drawing of a graph G is obtained by placing the n nodes of G on the intersections of a regular grid, such that each row and column of the grid supports exactly one node. This paper focuses on rook-drawings of planar graphs. We first give a linear algorithm to compute a planar straight-line rook-drawing for outerplanar graphs. We then characterize the maximal planar graphs admitting a planar straight-line rook-drawing, which are unique for a given order. Finally, we give a linear time algorithm to compute a polyline planar rook-drawing for plane graphs with at most n − 3 bent edges.


Introduction
Nowadays, large and dynamic graphs are widely used in the context of Big Data, and their visualization is a classical tool for their analysis.On one hand, when representing dynamic graphs, it is necessary to handle the addition or deletion of nodes or edges easily.On the other hand, when using hierarchical views, the ability to aggregate or de-aggregate sets of nodes is required [1,11].When doing such operations, it is important to preserve the mental map of the graph [4], as well as to compute the changes in the representation efficiently, both in order to guarantee a smooth use.
In the following, we define a new graph drawing style on a grid, that we call rook-drawing.In a rook-drawing, we require that the nodes of the graph lie on the intersections of a (n − 1) × (n − 1) regular grid, in such a way that each row and column hosts exactly one node.Then, the addition or deletion of a node impacts only the row and column it lies on, without interfering with other nodes or other parts of the drawing.In particular, dealing with aggregated data consists in stretching the grid to create enough room for the new appearing nodes (see Fig. 1).These operations clearly preserve orthogonal ordering, which is the first type of mental map defined in [14].Observe that this technique of having exactly one node per row and per column is also used by Kornaropoulos et al. [12,13] and by Angelini et al. [3], who represented edges with overlapping orthogonal polylines.Here we explore the existence of rook-drawings for planar graphs.The first question that comes to mind is: Does every planar graph admit a planar straightline rook-drawing, i.e. a rook-drawing in which each edge is represented by a segment and no two edges cross?De Fraysseix et al. showed that every planar graph admits a straight-line drawing on an (n − 2) × (2n − 4) grid [9].Schnyder improved this result by proving the existence of such a drawing on an (n − 2) × (n − 2)-grid [16].But in such drawings, some columns and rows contain several nodes and some others may be empty.Upward-rightward drawings presented by Di Giacomo et al. [10] are grid drawings in which all nodes have different y-coordinates, but empty rows and several nodes in a same column are allowed.
Contrasting with these results, we show that: • almost every maximal planar graph admits no planar rook-drawing (see Sect. 3) • every outerplanar graph admits a planar straight-line rook-drawing computable in linear time (see Sect. 4).
• every planar graph admits a polyline planar rook-drawing, i.e. a planar rook-drawing in which edges are drawn as polylines with bends placed on grid intersections (see Sect. 5).Moreover, this drawing can be computed in linear time, each edge is bent at most once and the total number of bends is at most n − 3.

Definitions
A drawing of a graph G is a mapping of the nodes of G to points on the plane and of the edges of G to curves between their endpoints.The drawing is straight-line if the edges are mapped to line segments.It is polyline if the edges are series of line segments.A grid drawing is a drawing in which the nodes are mapped to intersections of a regular grid.In such a drawing, we use positive coordinates (x(u), y(u)) for each node u.A k × l-grid is a grid of width k and height l.
Recall that a rook-drawing of a graph with n vertices is a (n − 1) × (n − 1)grid drawing, i.e. the functions x and y are bijections from the set of vertices to {1, . . ., n}.For simplicity, throughout this paper, the term "rook-drawing" denotes a straight-line rook-drawing unless otherwise stated.
A planar graph is a graph admitting a planar drawing, i.e. a drawing on the plane in which no two edges cross.Such a drawing can be characterized by the collection of circular permutations of the incident edges around each node of the graph, called an embedding.A planar graph together with an embedding is called a plane graph.
In a plane graph, the edges partition the plane into regions called faces.A rooted plane graph is a plane graph in which one face (called outer face) and one node (called root) lying on this face are distinguished.The nodes lying on the outer face are called outer nodes, all the other nodes are inner nodes.Similarly, outer edges are edges belonging to the outer face, the other edges are called inner edges.An outerplane graph is a rooted plane graph in which every node is on the outer face.A maximal plane graph is a plane graph with maximal number of edges, implying that every face is a triangle if the graph has at least three nodes.
A tree is a rooted plane graph without cycles.In a tree, a node u is a descendant of a node v (or v is an ancestor of u) if v is on the path from the root to u.Moreover, if v is connected to u, we say that v is the parent of u (and u is a child of v).Two nodes are said to be unrelated if one is neither ancestor nor descendant of the other.A leaf of a tree is a node of the tree without descendants.The depth of a tree is the length of the longest path from a leaf to the root in the tree.For a tree T and a node u, the subtree of u, denoted T (u), is the tree induced by u and all of its descendants.
The clockwise preorder of a tree T is a list of the nodes of T in the order of a clockwise depth-first search algorithm on T .The clockwise postorder of a tree T is a list of the nodes of T in the order of their last visit in a clockwise depth-first search algorithm of T .Counterclockwise preorder and postorder are defined similarly.

Existence of a planar rook-drawing
We define the tower plane graph T n of order n ≥ 3 as the plane join graph K 2 + P n−2 (i.e. a complete graph K 2 and a path on n − 2 nodes P n−2 together with all the edges joining nodes from K 2 to nodes of P n−2 ) drawn in such a way that the nodes of K 2 are on the outer face (see Fig. 2 for a drawing of T 6 ).The tower plane graph can also be seen as a planar 3-tree where the internal nodes induce a path.
Theorem 1 There exists a unique maximal plane graph on n ≥ 3 nodes admitting a planar rook-drawing, namely the tower plane graph T n .
Proof: Suppose we have a planar rook-drawing of a maximal plane graph G.We prove that G is the tower plane graph T n .
Let a, b, c be the three outer nodes of G. To maintain planarity, the inner nodes are placed at coordinates inside the area defined by the edges (ab), (bc) and (ca).Thus the outer nodes must occupy altogether the four borders of the grid, and one of them has to be placed in a corner.Without loss of generality, assume that a occupies the bottom-left corner.
Consider the positions of the two other outer nodes of G. Suppose one of them is in the top-right corner (without loss of generality, say b).If the third node c is placed below the edge (ab) (see Fig. 3a), then the second column on the left can not contain a node: the coordinates (k, 2) are outside the area delimited by the edges (ab), (bc) and (ca) for all k > 2. The point (2, 2) is covered by (ab) and the point (2, 1) can not contain a node because a is already on the first row.Finally, the inner nodes must be placed on coordinates (i, i) for 2 ≤ i ≤ n − 2, i.e. along a diagonal of the grid (see Fig. 3c).Now the positions of the nodes are determined and there is only one way to complete the drawing into a maximal plane graph, forming the graph T n .

Planar rook-drawing for outerplane graphs
In this section, we prove the following theorem: Theorem 2 Every outerplane graph admits a planar rook-drawing.This drawing can be computed in linear time.
To prove Theorem 2, we use a partition of the edges of an outerplane graph introduced in [5]: Theorem 3 (Bonichon, Gavoille and Hanusse [5]) Let G be an outerplane graph rooted in r.There exists a unique partition of the edges of G into two sets T and S such that:  • T is a spanning tree rooted in r • edges of S join a node u to the first unrelated node after u in the clockwise preorder of T .
Such a partition can be computed in linear time.
Remark that the clockwise preorder of T is exactly the reverse order of the counterclockwise postorder of T .We denote by y(v) the index of v in a counterclockwise postorder of T .We consider an orientation of the edges of T and S such that all edges of T are oriented towards the root r and the edges (uv) of S are oriented from u to v if y(u) > y(v).
The tree T can be computed by Algorithm 1 presented in [5].A call Traversal(G, ∅, r) returns the tree T of G rooted in r, the second parameter stands for the current set of edges of the tree during the execution.
For each node v of the outerplane graph G, we denote x(v) its index in counterclockwise preorder of T .Recall that y(v) is its index in counterclockwise postorder of T .
Lemma 1 Placing each node v of G at coordinates (x(v), y(v)) produces a planar rook-drawing of G.
Proof: By construction, the drawing D(G) obtained is a rook-drawing.It remains to show that this drawing is planar.
For a node v of G, let T v be the subtree of T rooted in v. Let G(v) be the subgraph of G induced by the nodes of T v .Let D(G(v)) be the drawing induced by the edges and nodes of G(v).The left branch of v in T v denotes the path between v and the first leaf found in a counterclockwise postorder of T v (see Fig. 4).
Let u and v be two nodes of G.The following observations are direct consequences of the definition of the x-and y-coordinates: (i) If (uv) is an edge of S from u to v, then v is the first unrelated node of T after u in clockwise preorder of T , and thus the first node unrelated to u with y(v) < y(u).
(ii) If u is parent of v in T , then x(u) < x(v) and y(u) > y(v).
(iii) Let (uv) be an edge of S with y(u) > y(v).Then v is before u in counterclockwise postorder of T .Since v and u are unrelated, v is also before u in counterclockwise preorder of T , i.e. x(v) < x(u).Thus the edges of S are going down and to the left.
We now want to prove by induction the following proposition : D(G(u)) is planar and drawn in the subgrid [x(u), x(u) When T u is reduced to a single node, the proposition clearly holds.Now assume the proposition holds for nodes having a subtree of depth at most k.Let u be a node with a subtree T u of depth k + 1. Denote by u 1 , ..., u m the children of u in clockwise order.Their subtrees in T are denoted T u1 , ..., T um .By induction hypothesis, the subtrees T u1 , ..., T um are placed in disjoint areas (see Fig. 4).Then D(G(u i )) and D(G(u j )) with i = j do not intersect.Thus T u is planarly drawn in the sub-grid [x(u), x(u) We now prove that the edges of S joining nodes belonging to different subtrees do not create any crossing in D(G(u)).Let v and w be nodes from different subtrees linked by an edge of S from v to w.By remark (i), w is the first node unrelated to v with y(w) < y(v).So v and w are in consecutive trees, say T ui and T ui+1 , and w = u i+1 .Thus all edges of S joining T i to T i+1 have u i+1 as an end: edges of S join nodes of the left branch of u i to u i+1 .Then by remarks (ii) and (iii), the edges of S can not cross each other or edges of the tree T .
Thus D(G(u)) is planar and this concludes the proof.
Remark that as Andrews [2] showed, a strictly convex grid drawing of a cycle of n nodes requires area Ω(n 3 ).Since a rook-drawing uses area O(n 2 ), it's not possible to produce strictly convex rook-drawing for the cycle for large n.
Also note that the existence of n nodes both in rook position and in general position, i.e. such that no three nodes are colinear (see definition in [15]), would imply an algorithm for generating a rook-drawing of outerplane graphs (from [8]).We do not know how to prove whether such a configuration exists.Remark though that the algorithm in [8] has complexity O(n log 3 (n)), while the algorithm presented here is linear.

Polyline rook-drawing for planar graphs
As we proved that some plane graphs do not admit a planar rook-drawing with straight lines, we now relax the straight-line constraint and look at planar polyline rook-drawings.We first recall the definition of Schnyder woods.

Properties of Schnyder woods
Definition 1 (Schnyder [16]) A Schnyder wood of a maximal plane graph G is a partition of the inner edges of G into three directed trees T 0 , T 1 , T 2 with the following properties: • each tree T i is rooted on a distinct outer node v i ; • the edges of each tree are directed toward the root; • each inner node u of G has one parent in each T i , denoted P i (u); • in counterclockwise order around each inner node, the outgoing edges are in T 0 then T 1 then T 2 ; • each ingoing edge belonging to the tree T i is placed after the outgoing edge in T i+1 mod 3 and before the outgoing edge in T i−1 mod 3 in counterclockwise order around an inner node.
Let T i be the tree T i plus the edges (v i−1 , v i ) and (v i+1 , v i ).The orientation of edges around an inner node is shown in Fig. 5, where T 0 is drawn solid, T 1 is dotted, and T 2 is dotted-dashed.Throughout the paper, we call a 0-edge (respectively 1-edge, 2-edge) an edge belonging to the tree T 0 (resp.T 1 , T 2 ).
P 2 (u) Lemma 2 ([6, Lemma 4]) For every inner node u, P i−1 (u) and P i+1 (u) are unrelated to u in T i .Moreover P i−1 (u) (resp.P i+1 (u)) appears before (resp.after) u in the clockwise preorder and postorder of T i .

Polyline rook-drawing algorithm
We here describe an algorithm to produce a planar polyline rook-drawing of a maximal plane graph of order n.The algorithm is inspired by an algorithm for polyline drawings proposed in [7].The original algorithm was designed to minimize the grid size and thus many rows and columns support several nodes.This new algorithm shares with the former the edge bending strategy, but the node placement is different.
Theorem 4 Every maximal plane graph G with n nodes admits a polyline planar rook-drawing D(G), which can be computed with Algorithm 2 in linear time.This drawing has n − 3 bends.
In Algorithm 2 and later, ll 0 (u) denotes the last descendant met in a clockwise preorder of u in T 0 .
We first make the following observations on the placement of nodes after applying Algorithm 2: • Since the nodes are placed according to their position in a preorder and a postorder, each row and column contains exactly one node.Thus D(G) is a rook-drawing.
• When u is a leaf of T 0 , then ll 0 (u) = u and this is the only case when the edge from u to P 1 (u) is drawn straight.

Planarity.
We first describe in the following some structural properties of the drawing with Lemmas 3 and 4.
Proof: Recall that the x-coordinates are given by a clockwise preorder of T 0 and that the y-coordinates are given by a clockwise postorder of T 1 .Hence we have that x(P 0 (u)) < x(u) and y(P 1 (u)) > y(u).Applying Lemma 2 with i = 1 we get that P 0 (u), u and P 2 (u) appear in that order in the clockwise postorder of T 1 .Hence y(P 0 (u)) < y(u) and y(P 2 (u)) > y(u).Applying again Lemma 2 but this time with i = 0 we get that P 2 (u), u and P 1 (u) appear in that order in the clockwise preorder of T 0 .Hence we have that x(P 2 (u)) < x(u) and x(P 1 (u)) > x(u).
From Lemma 3 and the coordinates of bends chosen for the edges in Algorithm 2, we observe that the configuration around an inner node follows the scheme illustrated in Fig. 7.
Lemma 4 For every inner node u we have the following statements: (ii) every node v such that x(u) < x(v) < x(P 1 (u)) is either a descendant of u in T 0 or y(v) < y(u) in D(G).
(iii) every node w such that x(P 2 (u)) < x(w) < x(u) is either a descendant of P 2 (u) in T 0 or y(w) < y(u) in D(G).
Proof: The first property is a direct consequence of the fact that the xcoordinates are given by the clockwise preorder of T 0 .Let v be a node such that x(u) < x(v) < x(P 1 (u)).By definition of x(v), either v is a descendant of u in T 0 , or it is in the area A delimited in the original graph G by the T 0 -paths (u, v 0 ) and (P 1 (u), v 0 ), and the edge (uP 1 (u)) in T 1 (see Fig. 8a).Note that v may belong to the path (P 1 (u), v 0 ).We consider the path P in T 2 from v to v 2 .Considering the relative orientations of the edges in the Schnyder wood, since v 2 is out of A, P has to intersect the border (u, v 0 ) of A to reach v 2 (even if v belongs to the T 0 -path (P 1 (u), v 0 ), its outgoing edge in T 2 heads into A).Let t denote the node at the intersection.There is a path in T 2 from v to t and a path in T 0 from u to t.By Lemma 3, y(v) < y(t) and y(t) < y(u), and thus y(v) < y(u).
A similar argument, exchanging the roles of T 1 and T 2 (see Fig. 8b), proves the third statement.
We now prove that the edges drawn do not cross.Lemmas 5 and 6 state such for the edges inside each tree T 0 and T 1 .Then we prove that edges from different trees do not cross with Lemmas 7, 8 and 9.After that, we show that edges from T 2 do not cross pairwise with Lemma 10.Finally, drawing the edge (v 1 v 2 ) with a straight line does not create any crossing, since all nodes and bends are placed on the same side of the straight-line defined by the nodes v 1 and v 2 .
For each node u of G, recall that we denote ll 0 (u) the last descendant met in the clockwise preorder of u in T 0 .

Lemma 5
The edges of T 0 do not cross in D(G).
Proof: We prove by induction on the depth k of subtrees in T 0 the following proposition: in D(G), the subtree of a node u in T 0 , denoted T 0 (u), is drawn planarly in the subgrid [x(u), x(u) + |T 0 (u)| − 1] × [y(u), n] (see Fig. 9).
The proposition clearly holds when k = 0. Assume the proposition holds for subtrees of depth at most k in T 0 .Let u be a node of G such that T 0 (u) is of depth k+1.Let u 1 , . . ., u m be the children of u (taken in the clockwise order).Nodes of T 0 (u) are consecutive in the clockwise preorder of T 0 and by Lemma 3, y(v) > y(u) for every node v of T 0 (u).Thus the drawing of the union of subtrees T 0 (u ) lies in [x(u), x(u)+|T 0 (u By the induction hypothesis the edges of these subtrees are drawn in disjoint areas, hence the drawing of the union of the subtrees is planar.Moreover, by construction the edges joining u to u 1 , . . ., u m do not cross each other and lie in a region free of edges from the subtrees (each node u lies in the bottom row of its dedicated area).Hence the drawing of T 0 (u) is planar.By construction of the bends for the edges joining u to u 1 , . . ., u m , T 0 (u) is also drawn in the subgrid [x(u), x(u)

Lemma 6
The edges of T 1 do not cross in D(G).
Proof: We prove by induction on the depth k of subtrees in T 1 the following proposition: in D(G), the subtree of a node u in T 1 , denoted T 1 (u), is drawn planarly in the subgrid [1, x(u)] × [y(u) − |T 1 (u)| + 1, y(u)] (see Fig. 10).
The proposition clearly holds when k = 0. Assume the proposition holds for subtrees of depth at most k in T 1 .Let u be a node of G such that T 1 (u) is of depth k +1.Let u 1 , . . ., u m be the children of u (taken in the clockwise order).Nodes of T 1 (u) are consecutive in the clockwise postorder of T 1 and by Lemma 3, x(v) < x(u) for every node v of T 1 (u).Thus the drawing of the union of subtrees T 1 (u l ) lies in [1, By the induction hypothesis, the edges of these subtrees are drawn in disjoint areas, hence the drawing of their union is planar.
Let now prove that the edges joining u and u 1 , . . ., u m do not cross each other.Recall that (u u) is bent at coordinates (x(ll 0 (u )), y(u )).Let u and u +1 be two consecutive children of u.Let us show that the bends (uu ) and (uu +1 ) are placed at positions with increasing y-coordinates and decreasing x-coordinates.By Lemma 3, y(u ) < y(u +1 ), thus the bends have increasing y-coordinates.We now prove that x(ll 0 (u +1 )) ≤ x(ll 0 (u )).By definition of the x-coordinates, all descendants of an inner node t in T 0 are placed on consecutive columns at the right of t.Since y(u ) < y(u +1 ), by contrapositive of Lemma 4.(ii), either u +1 is a descendant of u in T 0 or x(u +1 ) < x(u ).Suppose u +1 is a descendant of u in T 0 .By Lemma 3 and the definition of the x-coordinates, x(ll 0 (u +1 )) ≤ x(ll 0 (u )).Suppose now x(u +1 ) < x(u ).Thus all descendants of u +1 in T 0 have abscissas between x(u +1 ) and x(u ), hence x(ll 0 (u +1 )) ≤ x(ll 0 (u )).
Then the bends for the edges (uu ) are placed at positions with increasing y-coordinates and decreasing x-coordinates.Thus the edges joining u and u 1 , . . ., u m do not cross each other.These edges can not cross edges of a subtree of u in T 0 either, as each node u lies in the bottom row of the area dedicated to the drawing of T 0 (u) and the bent of the edge (u u) lies in the right-most column of this area.Hence the drawing of T 1 (u) is planar.

Lemma 7
The edges of T 0 and T 1 do not cross in D(G).If x(t) < x(u) (see Fig. 11a), then x(v) < x(t) < x(u).Since y(t) > y(u), by the contrapositive of Lemma 4.(iii), t is a descendant of v in T 0 .Then the orientation of the edges around t implies that either (uv) and (wt) do not cross, or (wt) also cross the T 0 -path (t, v), contradicting Lemma 7.
If x(u) < x(t), then x(w) < x(u) < x(t).u is not a descendant of w in T 0 (otherwise the bend of (wt) would prevent the crossing).Thus by definition of x(u), u is in the area A delimited in the original graph G by the paths (w, v 0 ) and (t, v 0 ) in T 0 , and the edge (wt) in T 1 (see Fig. 11b).Note that u may belong to the path (t, v 0 ) in T 0 .We consider the path P in T 2 from u to v 2 .Considering the relative orientations of the edges in the Schnyder wood, since v 2 is out of A, then P has to intersect the border (w, v 0 ) of A to reach v 2 (even if u is on the path (t, v 0 ), its outgoing edge in T 2 heads into A).Let z denote the intersection.By Lemma 3, y(z) < y(w).z is a parent of u in T 2 and thus a parent of v in T 2 (we may have z = v).Thus by Lemma 3, y(z) ≥ y(v) and thus y(w) > y(v), which is a contradiction.

Lemma 10
The edges of T 2 do not cross in D(G).
Proof: Let (uv) and (wt) be edges of T 2 .Suppose they cross each other.Thus x(w) > x(v), y(w) < y(v), x(t) < x(u) and y(t) > y(u).Since the two edges play similar roles, we can suppose without loss of generality that x(t) > x(v).Then x(v) < x(t) < x(u) and y(t) > y(u), and by Lemma 4.(iii), t is a descendant of v in T 0 .But then the edge (wt) would cross a 1-edge in the path of T 1 joining v to v 1 , contradicting Lemma 9.

Conclusion
In this paper, we observed that no maximal planar graph but the tower graphs admit a planar straight-line rook-drawing.On the other hand we showed that every outerplane graph admits a planar straight-line rook-drawing.A natural question is: are there other classes of plane graphs that all admit a planar straight-line rook-drawing?A plane graph that has a triangular outer face and admits a planar straight-line rook-drawing is necessarily a subgraph of the tower plane graph we described earlier.However, if we consider plane graphs with an outer face with at least 4 vertices, it seems that many of them should admit such a drawing.Then, plane graphs that do not contain non-facial triangles, as, for instance, quadrangulations or 4-connected triangulations with outer face of degree at least 4, are possibly good candidates for admitting a planar rookdrawing.
We also showed that every plane graph admits a planar polyline rookdrawing with at most n − 3 bent edges.Even if this number of bends is reasonable, one could ask if a linear number of bends is needed for allowing a planar rook-drawing of any planar graph.
Another interesting question would be to consider relaxed rook-drawing in which each row and column contains at most one node (and no longer exactly one node).Clearly every plane graph admits a planar relaxed rook-drawing: it suffices to consider a straight-line planar drawing of the plane graph and add a tiny perturbation to nodes sharing some coordinates.This naive approach produces drawings with a huge number of empty columns and rows, which is not suitable in practice.Hence the good question would be: does every plane graph admit a planar relaxed rook-drawing with a small (i.e.linear or sublinear) number of empty rows and columns?There are no evidence yet that even a constant number of empty rows and columns would not suffice.

Figure 1 :
Figure 1: Expansion of an aggregated node in a rook-drawing of a non-planar graph.

Figure 3 :
Figure 3: (a) and (b) Illustrations of the proof of Theorem 1. (c) A planar rook-drawing of T 6 .

DFigure 4 :
Figure 4: (a) The decomposition of an outerplane graph G rooted in r into T (solid edges) and S (dotted edges).(b) The rook-drawing of G produced by applying Lemma 1.The subtree of T rooted in v is drawn in the gray area D(G(v)).The left branch of v is the path between v and w.

Figure 5 :
Figure 5: Orientation around an inner node u in a Schnyder wood.

Figure 6 :
Figure 6: (a) Schnyder wood of a maximal plane graph G. (b) The polyline drawing D(G) obtained by Algorithm 2.

Figure 7 :
Figure 7: Edges orientation around an inner node v in D(G).The area at the top-right hand side of v i is the area in which the subtree of v i in T 0 is drawn.

5 ll 0 (u 5 )Figure 9 :
Figure 9: Illustration of the proof of Lemma 5.The area at the top-right hand side of u i is the area in which the subtree of u i in T 0 is drawn.

Figure 11 :
Figure 11: Illustration of the two cases for the proof of Lemma 9.

Figure 12 :
Figure 12: Illustration for the proof of Lemma 10.