Drawing Planar Cubic 3Connected Graphs with Few Segments: Algorithms and Experiments
Abstract
A drawing of a graph can be understood as an arrangement of geometric objects. In the most natural setting the arrangement is formed by straightline segments. Every cubic planar 3connected graph with n vertices has such a drawing with only \(n/2 + 3\) segments, matching the lower bound. This result is due to Mondal et al. [J. of Comb. Opt., 25], who gave an algorithm for constructing such drawings.
We introduce two new algorithms that also produce drawings with \(n/2 + 3\) segments. One algorithm is based on a sequence of dual edge contractions, the other is based on a recursion of nested cycles. We also show a flaw in the algorithm of Mondal et al. and present a fix for it. We then compare the performance of these three algorithms by measuring angular resolution, edge length and face aspect ratio of the constructed drawings. We observe that the corrected algorithm of Mondal et al. mostly outperforms the other algorithms, especially in terms of angular resolution. However, the new algorithms perform better in terms of edge length and minimal face aspect ratio.
Keywords
Line Segment Cognitive Load Edge Length Angular Resolution Visual Complexity1 Introduction
To assess the quality of network visualizations, many criteria have been investigated, such as crossing minimization, bend minimization and angular resolution (see [9] for an overview). The structural complexity of a graph is often measured in terms of its number of vertices or edges. This, however, does not necessarily correspond to its cognitive load (mental effort needed to interpret a drawing). Bends and crossings increase the cognitive load, making it harder to interpret a graph visualization, and should be avoided.
We consider the following measure of visual complexity for planar graphs [8]: the number of basic geometric objects that are needed to realize the drawing. For example, if a path in the graph is placed along a line, then we do not need one line segment for each edge in this path; one line segment can represent the entire path. In contrast to bends and crossings, which increase the cognitive load, this definition of visual complexity aims to measure a reduction in cognitive load in comparison to the structural complexity. The basic geometric shapes are typically straightline segments or circular arcs. Upper and lower bounds on the necessary visual complexity of various graph classes are known [2, 3, 8]. A lower bound for any graph is N / 2, where N is the number of odddegree vertices: at least one geometric object must have its endpoint at such a vertex. Computing the optimal visual complexity of linesegment drawings is NPhard [4].
We consider linesegment drawings for planar cubic 3connected graphs; unless mentioned otherwise, “graph” is used to refer to a graph of this class. Any plane drawing has at least three vertices of the same face on its convex hull: such a vertex is the endpoint of the line segment for each incident edge. Thus, we obtain a lower bound of \(n/2+3\) line segments, as n is even. Dujmović gave an algorithm for drawing general planar graphs with low visual complexity [2]. This algorithm will draw a cubic planar graph with \(n+2\) line segments. Mondal et al. [7] improve this by giving an algorithm that uses \(n/2 + 4\) segments. Moreover this algorithms places the vertices on a \((n/2+1) \times (n/2+1)\) grid and uses only 6 different slopes. A variant of the algorithm is also suggested, one that does not place the vertices on a grid and uses 7 distinct slopes, but attains a visual complexity of \(n/2 + 3\). The presentation of Mondal et al. contains a flaw, but it can be fixed as discussed in Sect. 4.
To compute a plane drawing matching the lower bound, we are given (or pick) three convex hull vertices; these are referred to as the suspension vertices. For all other internal vertices, we decide which two incident edges lie on the same line segment, that is, which of the three angles is flat. Hence, this corresponds to a flatangle assignment; we refer to plane drawings that match the lower bound as flatangle drawings. Note that any face in a flatangle drawing is nonstrictly convex. Aerts and Felsner [1] describe conditions for the stretchability of flatangle assignments. From a stretchable assignment, a layout can be obtained by solving a system of harmonic (linear) equations with arbitrary edge weights, very similar to the directed version of Tutte’s barycentric embedding as presented by Haas et al. [6]. How to efficiently compute stretchable flatangle assignments remains an open problem.
Contributions. We present two different new \(O(n^2)\)time algorithms (Sects. 2 and 3) to construct a plane drawing with \(n/2 + 3\) segments for \(n \ge 6\), matching the lower bound. From the constructed drawings, a flatangle assignment is derived, which is then used to set up a system of harmonic equations [1]. By solving the system using uniform edge weights we can redraw the layouts to (possibly) increase their visual appeal. To the best of our knowledge the new algorithms present novel methods to incrementally build up cubic planar 3connected graphs by simple and local modifications. These construction sequences might also find applications outside of our applications.
2 The Deconstruction Algorithm
For this algorithm we define an operation called edge insertion ^{2}: pick two edges that belong to one face, subdivide both edges and add a new edge between the new degree2 vertices while preserving planarity. It is folklore that every cubic 3connected graph can be obtained from \(K_4\) by a sequence of edge insertions (e.g., [5, page 243]). For our purpose we need a slightly stronger version (proven in the full version): any cubic planar 3connected graph other than \(K_4\) can be constructed by a sequence of edge insertions from the triangular prism, while not adding new edges in a given outer face (though outerface edges may be subdivided).

(R) We select the edge randomly from the set of all good edges.

(S) We select a good edge with minimal sum of the degrees of its incident faces.

(L) Analogous to (S), we select a good edge with maximal sum of degrees.
Once we have obtained the construction order, we can reconstruct the original graph from the triangular prism with a sequence of edge insertions maintaining a flatangle drawing (see Fig. 2). When inserting edges, we may have different possibilities how to update the flatangle assignment. Depending on our strategy we may obtain different drawings. If an edge insertion “connects” two edges that are not aligned, we have an obvious way how to add the new edge: we pick a subdivision point on each of the edges and add the new edge as a straightline segment connecting these points. If the two edges are aligned (part of a common segment \(\ell \)), we need to modify the existing drawing. Let u and v be the new vertices that we introduce and let \(s_1,\ldots , s_k\) be the vertices in between u and v on \(\ell \); see Fig. 3(a). Since the graph after adding e is planar, all segments starting at \(s_i\) have to leave \(\ell \) on the same side. We first draw the new edge (u, v) on top of \(\ell \) such that v coincides with \(s_k\). To repair the degeneracy, we tilt the old part of \(\ell \) that was running between u and \(s_k\) as done in Fig. 3(b). Here we let \(s_k\) “slide” on its segment that was not part of \(\ell \). For \(k \ge 2\) we have also the following alternative how to insert (u, v): we draw a segment parallel to \(\ell \) that runs between the segments starting at \(s_1\) and \(s_k\). We place all endpoints \(s_i\) on this new segment without changing any slopes of the old segments. We now take the old vertex \(s_1\) as u, and the old vertex \(s_k\) as v as depicted in Fig. 3(c). We refer to the latter strategy as the alternate insertion operation.
With three different strategies (R, S and L) and an alternative insertion operation (ALT), we have six variants of the Deconstruction algorithm, referred to as DECR, DECRALT, DECS, DECSALT, DECL and DECLALT.
3 The Windmill Algorithm
 1.
If at most one vertex lies inside C, we draw all chords as line segments. The one vertex (if present) is positioned to lie on a line segment between two of its neighbors. See Fig. 4(b\(\rightarrow \)c,e\(\rightarrow \)f).
 2.
If a face occurs more than once in F, we draw its paths inside C as line segments and recurse on a subcycle for each path. See Fig. 4(c\(\rightarrow \)d).
 3.
If two faces share an edge, but are not consecutive in F, we draw three line segments to represent the paths inside C along the two faces and recurse on the two subcycles created. See Fig. 4(a\(\rightarrow \)b).
 4.
Otherwise, we create a windmill pattern with the sequence of faces along C. We recurse on the cycle inside the windmill. See Fig. 4(d\(\rightarrow \)e).
To construct a windmill, we proceed as follows (see Fig. 5). First, we consider the dual of the given graph, restricted to the vertices that are dual to the faces in F. Ideally, this is a simple cycle. However, two nonconsecutive faces of F that are adjacent (and, because of case 3, lie on the same side of C) cause a chord in this cycle. We find the shortest cycle in this restricted dual to create the windmill (Fig. 5(a)). The face boundaries of the faces on this cycle are decomposed as to provide the basic windmill structure (Fig. 5(b)). This bypasses any components separated by a chord in the dual. These are inserted as triangles at the correct place and recursed on as well, after drawing the windmill pattern (Fig. 5(c)).
Windmills can be created in a clockwise or counterclockwise direction. To decide, we provide two strategies. The first is to always choose the same direction; the other is to alternate clockwise and counterclockwise, depending on the recursion depth. We refer to these variants as WIN and WINALT respectively.
4 The Mondal Algorithm
Mondal et al. [7] describe two lineartime algorithms for drawing cubic planar 3connected graphs: one results in a grid drawing with \(n/2 +4\) line segments; the other attains minimal visual complexity but does not produce a grid drawing. Both algorithms introduce the vertices as given by a canonical order.
To resolve this issue, we suggest the following procedure for determining the correct pivot point. For case 4b, we walk downward along the slope 1 edges, until we find a pivot vertex p that has either two slope 0 edges or a downward edge with slope 1 and downward edge with slope \(\infty \). In this case, every vertex w along the path is moved \(\ell (w)\) positions to the left, where \(\ell (w)\) is the vertical distance between w and pivot vertex p. We refer to this as a leftrotation. The correct result for the counter example is given in Fig. 6(d).
Analogously for case 4d, we walk downward along the slope \(\infty \) edges, until we find a pivot vertex p that has either two slope 0 edges or a downward edge with slope 1 and downward edge with slope \(\infty \). In this case, every vertex w along the path is moved r(w) positions to the right, where r(w) is the vertical distance between w and pivot vertex p. We refer to this as a rightrotation.
To prove that left and rightrotations maintain a plane drawing, we must show that for every degree3 vertex along the path to the pivot vertex, any horizontal edge in the direction of the rotation has sufficient length. This is captured by the invariant below. To simplify notation, we define r(w) and \(\ell (w)\) to be 0, if w is not on a path that may be rightrotated or leftrotated respectively.
Invariant 1
Consider an edge \(e = (u,v)\) with slope 0 and let u and v be its left and right vertex respectively. The length of e is at least \(1 + r(u) + \ell (v)\).
Observe that r(u) or \(\ell (v)\) is nonzero only in situations where u has been leftrotated or v has been rightrotated. To fully prove this statement is out of scope for this paper. Also, note that this is the invariant for the grid algorithm. For the minimalcomplexity algorithm, we must multiply the values of \(r(\cdot )\) and \(\ell (\cdot )\) by two, and observe that rotations are not performed with slope \(\infty \) edges: their role is taken by slope \(1\) edges.
Moreover, we observe that the Mondal algorithm achieving minimal visual complexity can be easily adapted to lie fully on a grid and use only six slopes as well. To this end, we need to do only the following: whenever the bottom point is moved to the right, it is moved downwards for an equal distance. This ensures that its incident edge maintains a slope of \(1\).
Thus, we have two variants of the Mondal algorithms, both on a grid and with only 6 slopes for its edges: one uses \(n/2 + 4\) line segments, but draws on a smaller grid than the second algorithm that uses only \(n/2 + 3\) line segments. We refer to these as MONGRID and MONMIN respectively.
5 Experiments
We have three different algorithms (each with its own variants) to draw planar cubic 3connected graphs using only \(n/2 + 3\) line segments. The drawings (Fig. 1) are obviously different, but—as the visual complexity is the same—we need criteria to further assess the overall quality. In this section we discuss experimental results comparing the 10 algorithm variants described in the previous sections.
5.1 Graphs
We generated all planar cubic 3connected graphs with 24, 26, 28 and 30 vertices, using plantri ^{3}. From each batch we sampled 500 graphs uniformly at random, resulting in a total of 2000 graphs. The Wolfram data set shows roughly the same patterns can be observed as for the random data set. As the graphs in this data set are typically smaller, some differences arise.
5.2 Measures
We use the following three measures to quantify the quality of a graph layout.
Angular Resolution. At each internal vertex in the graph, we measure the smallest angle as an indicator of angular resolution. Since one angle is always \(\pi \), the best angular resolution is \(\pi / 2\). Angular resolution measures how easily discernible the incident edges are. A high value indicates a good angular resolution.
Edge Length. We measure all edge lengths in the graph, normalized to a percentage of the diagonal of the smallest enclosing axisaligned square. Though edge lengths should neither be too short nor too long, we in particular look at avoiding long edges^{4}: we consider lower values for edge length to be better.
Aspect Ratio. For each face, we measure the aspect ratio of the smallest enclosing (not necessarily axisaligned) rectangle. To compute this ratio, we divide the length of its shorter side by the length of its longer side, yielding a value between 0 and 1. High values thus indicate a good aspect ratio. This is a simple indicator of fatness, as all faces are convex.
Measuring Procedure. For each graph, we run each algorithm using each possible face of the graph as an outer face. For each measure, we compute both the average value over all elements (vertices, edges, faces) as well as the worst value. The worst value is the minimum value for angular resolution and face aspect ratio, and the maximum value for the edge length. For both the average and worst value, we compute the average over all drawings for a particular graph, i.e., what may be expected for that graph if we had chosen an outer face uniformly at random. Thus, we have six measures in total.
5.3 Algorithm Comparison
Angular Resolution. The MON algorithms clearly perform better than the WIN algorithms, which in turn outperform the DEC algorithms. This was to be expected due to the fixed slopes used in the MON algorithms. We observed that for the Wolfram data set, the angular resolution tends to increase for the WIN and DEC algorithms. However, for the MON algorithms, there in fact seems to be a slight decrease.
Edge Length. The worstcase values show that the MON algorithms perform worst, and the WIN algorithms perform best; average edge length shows that MON is slightly behind the WIN and DEC algorithms. Though statistically significant (later in this section), the differences are only minor. The maximum edge length for the WIN and DEC algorithms is lower due to its placement in an equilateral triangle and the possibility of having additional vertices on all sides of this triangle; the MON algorithms always have a long edge, close to the diagonal of the drawing. For the MONMIN algorithm, this worstcase edge length is smaller than for MONGRID. This is caused by our modification which moves one point downward, thereby increasing the grid size.
Face Aspect Ratio. We see that the DEC algorithms are outperformed by the other algorithms in terms of average ratio. MONMIN outperforms MONGRID and the WIN algorithms. However, looking at the minimal face aspect ratio of a drawing, we see that DEC outperforms the MON algorithms, and MONGRID is actually slightly ahead of MONMIN. For the Wolfram data set, containing smaller graphs (\(n = 16.5\) on average), we observe that the average face aspect ratio of the MON algorithms decreases: MONMIN is in line with the DEC algorithms and the MONGRID algorithm has lost its lead on the WIN algorithms.
We conclude from the above that the WIN algorithms generally outperform DEC algorithms. Between the WIN and MON algorithms, there is no clear agreement between the measures: the MON algorithms perform very well in angular resolution, but worse in edge length; for the face aspect ratio, it depends whether we consider the average or minimum ratio in a drawing.
Statistical Analysis. We further investigate the differences by performing an RMANOVA analysis on the measurements with a posthoc Tukey HSD test to reveal the pairwise differences. The Skewness and Kurtosis of all measurements are within the range \([2,2]\), thus providing evidence for the assumption of the normal distribution for these analyses. The only exception is the minimal angular resolution for the MON algorithms, which are constant at \(\pi /4\). These are excluded from the statistical analysis; we consider the MON algorithms to (significantly) outperform the other algorithms due to the high difference in means.
We verify that the WIN algorithms clearly outperform the DEC algorithms, in at least four measures (out of six). Between the two variants, there is no difference. As observed above, whether the MON algorithms outperform another algorithm depends highly on the measure. The MONMIN algorithm “wins” more often than it “loses” compared to any other algorithm. However, the MONGRID algorithm is outperformed by the WIN algorithms. The DEC algorithms are not distinguishable between themselves. They outperform the MON algorithms for some measures, but are outperformed by the MON algorithms more often.
6 Conclusions
We studied algorithms for drawing cubic planar 3connected graphs with minimal visual complexity, i.e., with as few line segments as possible. The lower bound is \(n/2 + 3\) for a graph with n vertices, and we introduced two new algorithms to match this lower bound. These algorithms may be of independent interest, as a way of constructing planar cubic 3connected graphs. Moreover, we resolved a flaw in an existing algorithm by Mondal et al. [7].
This leaves us with three algorithms, each with two or more variants. We performed an experiment with two data sets to compare the performance of these algorithms in terms of angular resolution, edge length and face aspect ratio. The Deconstruction algorithm is always outperformed by the Windmill algorithm, but the Windmill algorithm seems to be on par with the Mondal algorithm: depending on the criterion, one or the other performs better. One aspect that was not taken into consideration though, is that the Mondal algorithm comes with a maximum grid size and uses only 6 slopes to draw the line segments.
Future Work. We studied visual complexity for planar cubic 3connected graphs, which is rather restrictive. Future algorithmic work may aim towards reducing the gap between upper and lower bounds for other graph classes such as triangulations or general planar graphs (see [3]). Moreover, the definition of visual complexity is not limited to line segments, but may include for example the use of circular arcs (see [8]). We may investigate how many vertices are spanned by a line segment—but what is “better” here is not immediately clear. Moreover, we may look into applying the system of harmonic equations to the Mondal layouts.
Furthermore, it would be interesting to investigate whether the definition of visual complexity correlates to an observer’s assessment of complexity. In other words, are drawings with minimal visual complexity indeed perceived to be simpler than those with higher visual complexity? Moreover, can we establish a relation between visual complexity and cognitive load? The graph may be visually simpler, but that does not readily imply that it is easier to interpret.
Footnotes
References
 1.Aerts, N., Felsner, S.: Straight line triangle representations. In: Wismath, S., Wolff, A. (eds.) GD 2013. LNCS, vol. 8242, pp. 119–130. Springer, Heidelberg (2013) CrossRefGoogle Scholar
 2.Dujmović, V., Eppstein, D., Suderman, M., Wood, D.: Drawings of planar graphs with few slopes and segments. CGTA 38, 194–212 (2007)zbMATHGoogle Scholar
 3.Durocher, S., Mondal, D.: Drawing plane triangulations with few segments. In: Proceedings of 26th CCCG, pp. 40–45 (2014)Google Scholar
 4.Durocher, S., Mondal, D., Nishat, R., Whitesides, S.: A note on minimumsegment drawings of planar graphs. J. Graph Algorithm Appl. 17(3), 301–328 (2013)MathSciNetCrossRefzbMATHGoogle Scholar
 5.Grünbaum, B.: Convex Polytopes (Graduate Texts in Math), 2nd edn. SpringerVerlag, New York (2003) CrossRefGoogle Scholar
 6.Haas, R., Orden, D., Rote, G., Santos, F., Servatius, B., Servatius, H., Souvaine, D.L., Streinu, I., Whiteley, W.: Planar minimally rigid graphs and pseudotriangulations. Comput. Geom. 31(1–2), 31–61 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
 7.Mondal, D., Nishat, R., Biswas, S., Rahman, S.: Minimumsegment convex drawings of 3connected cubic plane graphs. J. Comb. Opt. 25, 460–480 (2013)MathSciNetCrossRefzbMATHGoogle Scholar
 8.Schulz, A.: Drawing graphs with few arcs. In: Brandstädt, A., Jansen, K., Reischuk, R. (eds.) WG 2013. LNCS, vol. 8165, pp. 406–417. Springer, Heidelberg (2013) CrossRefGoogle Scholar
 9.Tamassia, R.: Handbook of Graph Drawing and Visualization. CRC Press, Boca Raton (2013)Google Scholar