Abstract
Many algorithms have been designed to remove node overlapping, and many quality criteria and associated metrics have been proposed to evaluate those algorithms. Unfortunately, a complete comparison of the algorithms based on some metrics that evaluate the quality has never been provided and it is thus difficult for a visualization designer to select the algorithm that best suits his needs. In this paper, we review 21 metrics available in the literature, classify them according to the quality criteria they try to capture, and select a representative one for each class. Based on the selected metrics, we compare 8 node overlap removal algorithms. Our experiment involves 854 synthetic and real-world graphs.
You have full access to this open access chapter, Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
Graph drawing algorithms are good at creating rich expressive graph layouts but often consider nodes as points with no dimensions. After changing the size of nodes in the case of annotation or evolving graphs, it causes node overlap which hides information. Post-process algorithms, named layout adjustment [15], have been proposed to remove node overlap.
The objective of these algorithms is, given an initial positioning of the nodes and a size for each one, to provide a new embedding so that there are no overlapping nodes any more. A classical zoom-in function maintaining the sizes of the nodes (i.e. uniform scaling) provides such an embedding, but it expands the visualisation, resulting in large areas without any objects. Therefore, a node overlap removal algorithm must take into account the area of the drawing, and try to minimise it. Positioning the nodes evenly on a grid meets this objective but will result in the loss of the user’s mental picture of the original embedding. Thus, it is also important to minimise the change on the layout.
Since a preliminary work in 1995 [15], many algorithms have been designed to reach these purposes, and many quality criteria have been proposed to evaluate them. Unfortunately, a complete comparison of the algorithms based on the different criteria has never been provided and it is thus difficult for a visualisation designer to select the one that best suits his needs.
In this paper, our contribution comes in two forms: (1) We propose a classification of 21 quality metrics, grouping them according to the quality criterion they try to capture. We also discuss their relevance and we select a representative one for each class. (2) We compare state-of-the-art node overlapping approaches in regards to the previously selected metrics. This experiment involves 854 graphs, including synthetic ones (random, tree, scale-free, small-world) and real world ones.
The paper is organised as follows: after a brief reminder in Sect. 2 of the definitions and the notations used in this paper, we present and discuss the quality criteria and the metrics in Sect. 3. Then we compare the algorithms in Sect. 4. Finally we conclude in Sect. 5.
2 Preliminaries
In this paper, we use the following definitions and notations.
\(G = (V, E)\) denotes a graph where V is the set of nodes and E the set of edges. The number of nodes |V| is denoted by n and the number of edges |E| by m. We consider each node as a rectangle. Thus, for a node \(v\in V\), its width and its height are denoted by the couple \((w_v, h_v)\) which is not impacted by the layout adjustment.
The initial embedding is defined as an injection \(\mathcal {E}_G : V \rightarrow \mathbb {R}^2\) such that \(\forall v\in V\), \(\mathcal {E}_G(v) = (x_v, y_v)\) where \((x_v, y_v)\) are the coordinates of the center of the node v. The overlapping-free embedding is denoted by \(\mathcal {E}'_G\). To simplify notations, we denote \(v = (x_v, y_v)\) instead of \(\mathcal {E}_G(v)\), and \(v' = (x'_v, y'_v)\) instead of \(\mathcal {E}'_G(v)\). Remark that two nodes \((u, v) \in V^2\) are overlapping when :
The bounding box Bb of an embedding \(\mathcal {E}_G\) is defined as the smallest rectangle containing all the nodes of G; \(w_{bb}\) (resp. \(h_{bb}\)) denotes the width (resp. the height) of the initial embedding, \(w'_{bb}\) (resp. \(h'_{bb}\)) denotes the width (resp. the height) of the overlapping-free one. They are determined as follows:
The position of the center of the bounding box is denoted by \(c_{bb}=(x_{bb},y_{bb})\) in the initial embedding, and \(c'_{bb}=(x'_{bb},y'_{bb})\) in the overlapping-free embedding.
The convex hull of an embedding \(\mathcal {E}_G\) is defined as the smallest convex region containing all the nodes of G. Note that it is computed by using the 4 corners of the nodes, and not only their center, in a way that the rectangles representing the nodes are fully included into it. In the following, Ch denotes the convex hull of the original embedding, \(Ch'\) the convex hull of the free-overlapping one, \(c_{ch}\) the center of mass of Ch, \(c'_{ch}\) the center of mass of \(Ch'\).
3 Quality Criteria
Many criteria have been proposed in the literature to evaluate the quality of the embeddings resulting from adjustment algorithms. Unfortunately, the experiments provided by the authors of the different approaches are not always based on the same metrics. With a view to provide a uniform protocol of experiment and a complete comparison of the algorithms, we need to review the quality criteria and the metrics used to evaluate them. We also need to select a representative metric for each criterion.
We identified 5 classes of metrics (Orthogonal Ordering preservation, Spread minimisation, Global Shape preservation, Node Movement minimisation and Edge Length preservation), each of them depicting a quality criterion. Table 1 shows the metrics assigned into the classes. The formulas are given in the discussion below.
The following subsections contain the metrics of a specific class. In each of them, we select one representative metric, based on the corresponding quality criterion and the properties that the metrics aim at capturing. Our discussion also sometimes involves the coefficient of correlation of two metrics run following the protocol described in the comparison section, Sect. 4.
3.1 Orthogonal Ordering Preservation
The orthogonal ordering class groups the metrics which try to quantify how much an adjustment algorithm preserves the initial orthogonal ordering. We recall that the orthogonal ordering is respected when all nodes satisfy the following conditions:
The first metric of this class, \(oo\_o\) [15], is equal to 1 if the overlapping-free graph embedding preserves the initial orthogonal ordering, 0 otherwise. Also, if only one couple of nodes does not satisfy those conditions, the value of \(oo\_o\) is the same as when many ones do not satisfy it.
To overcome this issue, Huang et al. [11] proposed a metric based on the Kendall’s Tau distance. For each couple of nodes, they first compute an inversion number \(\textit{inv}(u, v)\) corresponding to 0 if the orthogonal ordering is preserved between them, 1 otherwise. The metric is then defined as the normalised sum of the inversion numbers:
Strobelt et al. [17] introduced the number of inversions:
This metric has the drawback of providing non-normalized values. However, it holds the benefit of penalizing inversions occurring on each axis independently (\(x-\) and \(y-axis\)), instead of penalizing in the same manner an inversion occurring in only one axis and an inversion occurring in the two axes. Thus, in our study, we combine the two metrics by using a normalised version of the latter:
3.2 Spread Minimisation
A classical zoom-in function maintaining the sizes of the nodes (i.e. uniform scaling) provides an overlapping-free embedding, but it expands the visualisation, resulting in large areas without any objects. To avoid this issue, quality metrics have been introduced to quantify embedding spreading. Their purpose is to favour algorithms inducing low spreading.
The L1 metric length [12] is the ratio:
The drawback of this technique is to consider only one dimension of the embedding, width or height. For instance, considering an example where \(w_{bb}=4\), \(h_{bb}=2\), \(w'_{bb}=4\), \(h'_{bb}=4\), the value of the L1 metric length is 1 (which is the target value), whereas the area of the overlapping-free embedding is twice as large as in the initial embedding. The ratio between the bounding box areas of the two embeddings [15] overcomes this issue:
While the result gives an unbounded value greater than 1, Huang et al. [11] proposes a normalised version producing values in the interval [0, 1[:
Unfortunately, this criterion is poorly intuitive and it is hard to figure out what the values represent.
In our comparison, we selected another version of the ratio of areas involving convex hulls [17], as it better captures the concrete area of the drawing:
3.3 Global Shape Preservation
This class contains metrics that try to capture the ability of the algorithms to preserve the global shape of the initial embedding. The first one was proposed by Li et al. [12]:
The underlying idea is to capture the variation of the aspect ratio (\(w_{bb}/h_{bb}\)) between the initial and the overlapping-free embedding. For instance, let us consider an example where \(w_{bb}=3\), \(h_{bb}=2\), \(w'_{bb}=6\), \(h'_{bb}=4\). In this case, the overlapping-free embedding is twice as large as the initial one but the aspect ratio remains the same 3/2. The \(gs\_bb\_ar\) is 1, which is the target value. Now let us consider another example where \(w_{bb}=3\), \(h_{bb}=2\), \(w'_{bb}=4\), \(h'_{bb}=6\). In this case, the initial aspect ratio is 3/2 whereas the overlapping-free one is 2/3. The \(gs\_bb\_ar\) is now 2.25, which is not the target value; it reveals a distortion of the initial embedding during the overlap removal process. The main drawback of this metric is that it can reach values in the interval \(]0, +\infty [\) while the target value is 1. Thus, it is hard to decide, for instance, which algorithm is the best between two of them if the first one obtains a score of 0.67 and the second one a score of 4.56. To overcome this issue, we propose to refine it as follows:
In this case, the target value is 1 and the metric cannot reach values below it. This criterion is the one we selected for our study.
An alternative to this approach based on the convex hull has been proposed by Strobelt et al. [17]. The idea is to evaluate the distortion of the convex hull by comparing, between both embeddings, the distances of convex hull points to their center. Let \(\ell _\theta \) (resp. \(\ell '_\theta \)) be the euclidean distance between the center of mass \(c_{ch}\) (resp. \(c'_{ch}\)) of the convex hull Ch (resp. \(Ch'\)) and the intersection of the convex hull with the line going through \(c_{ch}\) (resp. \(c'_{ch}\)) and with an angle \(\theta \) (\(\theta \) varying from \(0^{\circ }\) to \(350^{\circ }\) in \(10^{\circ }\) steps). Then, the difference is defined as the ratio \(d_\theta = \ell '_\theta /\ell _\theta \). The metric is the standard deviation of the 36 measures of \(d_\theta \):
Based on the experiments presented below in Sect. 4, we observed that \(gs\_bb\_iar\) and \(gs\_ch\_sd\) have a correlation coefficient of 0.77, showing that they both tend to capture similar aspects of the adjustment process. We selected the former for its simplicity and its ease of interpretation.
3.4 Node Movement Minimisation
This class contains the metrics quantifying the changes in node positions after running an adjustment algorithm. The underlying intuition is that an algorithm involving high node movements will provide an overlapping-free configuration different from the original one, and thus may result in a substantial loss of the mental model.
The simplest metric of this class was presented by Huang et al. [11]:
Here, nb represents the number of nodes which have moved between the initial and the overlapping-free embedding. The main drawback of this approach is that a node overlap removal algorithm may induce very small changes in most nodes, which does not affect the mental model preservation, while inducing a very bad result. To tackle this problem and add more granularity over the evaluation of node movements, a series of metrics have been proposed, based on the same underlying quality function:
where f is a normalising function of \(n=|V|\) and dist is a distance between v and \(v'\). Table 2 sums up the ones used in the literature.
The function f comes in three different forms. Marriott et al. [14] and Huang et al. [10] do not include any f, which is similar to having \(f(n)=1\). The drawback is that the resulting value highly depends on the number of nodes in the graph. That is why Strobelt et al. [17] proposed to use the mean of the distances, which corresponds to \(f(n)=1/n\). Finally, Lyons et al. [13] proposed \(f(n)=1/(k\sqrt{2}\times n)\), where k is the maximum between \(w'_{bb}\) and \(h'_{bb}\). In this case, \(k\sqrt{2}\) is the diagonal of a square containing the embedding, thus a maximum distance available for a node. Thus, this f function normalises the values of the metric. Unfortunately, this normalisation induces very small values that are hard to interpret. That is why we preferred using \(f(n)=1/n\) for our study.
Three dist functions have been proposed in the literature. The most intuitive one is the Euclidean distance \(\left||v' - v\right||\) [13, 17]. The squared Euclidean distance \(\left||v' - v\right||^2\) [14] avoids the square root computation and discriminates high changes better. It is the one we selected for our study. The Manhattan distance \(|x'_v - x_v| + |y'_v - y_v|\) has also been used [10], but it is less intuitive and has close results (\(nm\_dm\_se\) and \(nm\_dm\_h\) have a correlation coefficient of 0.9).
Let us consider an adjustment algorithm that pushes nodes on the x-axis. The preservation of the global shape is not optimal but the preservation of the configuration should reach a good score, as a node on right-top in the initial embedding would remain on right-top in the overlapping-free embedding. In order to better capture the relative movement of a node between the two embeddings, a shift function can be applied to align the center of the initial bounding box with the center of the final one, and a scale function to align the size of the initial bounding box to the size of the final one:
Considering this, we selected the following node movement metric:
\(nm\_d\) [5] (the complete formula is available in the paper) is also based on the idea that the metric should be based on modified initial positions to better capture the relative movement of the nodes between the two embeddings. Besides including the shift and the scale functions, it also rotates the initial embedding with an angle \(\theta \) that minimizes the distances between the nodes of the initial embedding and the ones of the overlapping-free embedding:
We have not included the rotation in our experiment as we consider that it can induce a loss of the mental model (think about the recognition of a map turned inside down).
An alternative to quantify how much an overlapping-free configuration may result in a substantial loss of the mental model is to look at the neighbourhoods at the nodes and compare them before and after the adjustment. Based on a KNN approach, Nachmanson et al. [16] proposed the following metric:
where \(N_k(v)\) (resp. \(N_k(v')\)) denotes the k nearest neighbours of v (resp. \(v'\)), in terms of Euclidean distance, in the initial (resp. overlapping-free) embedding. We did not select this metric because, unlike the other metrics of the class, it requires to fix a parameter (k).
3.5 Edge Length Preservation
This class contains the two metrics based on edge lengths. The set of edges can be E or can be another set derived from the graph.
Standard force-based layout algorithms tend to produce uniform lengths of edges. Indeed, the first metric of this class captures whether the edge lengths of a graph remain uniform or not after applying an adjustment algorithm [12]:
While many layout algorithms are not designed to produce uniform edge lengths, we did not select this approach, which is not related to the mental model preservation for these algorithms. We preferred the next one, based on a Delaunay triangulation.
Let \(E_{dt}\) be the set of edges of a Delaunay triangulation performed on the nodes of the initial embedding. The second metric of this class, \(el\_rsdd\), is based on computing the coefficient of variation, also known as the relative standard deviation, of the edge lengths ratio as follows [5]:
4 Algorithms Comparison
In this section, we compare 8 algorithms of the literature in terms of quality and running time: uniform Scaling, PFS [15], PFS’ [8], FTA [11], VPSC [3], PRISM [5], RWordle-L [17], and GTREE [16]. The quality of an overlapping-free embedding is evaluated with the metrics identified in the last section, by following a 3 steps procedure: Step 1: Datasets We generate 840 synthetic graphs containing 10 to 1,000 nodes. These graphs are provided by 4 generation models available on the OGDF library [2]: random graphs [4], random trees, small world graphs [18], and scale-free graphs [1]. We also use 14 real-world graphs selected from the \(\text {Graphviz}\) test suiteFootnote 1 [6], previously used by the authors of PRISM [5] and GTREE [16]. Step 2: Overlapping-free embedding computation Synthetic graphs resulting from the first step are initially positioned by the \(FM^3\) layout algorithm [7]. Then, we apply the 8 node overlap removal algorithms, thus providing a set of 6,720 overlapping-free graph embeddings. Graphviz test suite graphs are initially positioned by the SFDP layout algorithm [9] to follow the same baseline embedding as Gansner et al. [5]. We then apply the 8 node overlap removal algorithms thus providing 112 overlapping-free graph embeddings. Step 3: Metrics computation We finally compute the values of the 5 selected metrics on the 6.832 overlapping-free synthetic and real-world graph embeddings. We also measure the computation time of the algorithms.
4.1 Quality
Figure 1 and 2 show the aggregated metrics values on the synthetic and real-world datasets. Unsurprisingly, Scaling, PFS and PFS’ obtain the best scores at \(oo\_nni\) as it is proved that they maintain the original orthogonal ordering. Though, all the algorithms tested got good results for this criterion.
Scaling highly increases the size of the embedding, which induces a bad score for \(sp\_ch\_a\). PFS also obtains a bad score for this criterion. VPSC and RWordle-L produce the most compact embeddings, while the other algorithms give intermediary results.
Scaling preserves the initial global shapeFootnote 2 (\(gs\_bb\_iar\) score). PFS is the worst algorithm on this criterion. The other algorithms obtained good median scores on synthetic graphs, but the third quartile scores show that FTA and VPSC can produce a certain amount of distorted embeddings. This is confirmed by the tests on real-world graphs, where they obtain worse results.
Scaling obtains the best results for the node movement minimisation criterion, followed by VPSC and RWordle-L. FTA also obtained a good median score on synthetic graphs, but its third quartile value shows that it can generate a certain amount of embeddings with high changes, as also illustrated by the bad score obtained on the real-world graphs. PFS’ and PRISM obtained intermediary results. Finally, GTREE had bad results on the synthetic graphs, while it obtained pretty good ones on the real-world graphs.
Scaling preserves relative edge lengths. All the other criteria obtained comparable median score between 0.17 and 0.31. However, the third quartile on the synthetic graphs shows that FTA, VPSC and RWordle-L generate a certain amount of embeddings with high variations. This observation is confirmed by the results on the real-world graphs for FTA and RWordle-L.
4.2 Computation Time
Figure 3 and 4 show the aggregated running time values on the synthetic and real-world datasets. Scaling, PFS, PFS’ and VPSC require lower running time. FTA and GTREE induce intermediate running time, but the third quartile shows that FTA can induce a certain amount of time consuming embedding computations. Finally, PRISM is time consuming for small graphs, but have intermediate results for larger graphs, while RWordle-L has good results for small graphs but is very time-consuming for larger ones.
5 Conclusion
As a conclusion, even if Scaling optimises 4 out of 5 criteria and is very fast to compute on the graphs of our datasets, it does not represent a satisfying solution as it increases the size of the embedding too much. PFS is also not satisfying as it got poor results on 3 criteria. FTA obtained intermediate results over all the criteria, which is less good than all its remaining competitors. PFS’ and PRISM obtained comparable results but the latter is more time-consuming. Both have intermediate results for shape preservation and node movement minimisation, which might be considered as two essential criteria. GTREE suffers from inducing high node movements on our datasets. Overall, VPSC and RWordle-L obtained the best quality results. While RWordle-L outperforms VPSC on global shape preservation and is comparable on the other criteria, VPSC outperforms RWordle-L in terms of running time. Finally, considering the different types of graphs (random graphs, random trees, small world graphs, and scale-free graphs), we did not observe any significant differences in terms of results.
Notes
- 1.
https://gitlab.com/graphviz/graphviz/blob/master/rtest/graphs/ (accessed: 2019-07).
- 2.
The global shape preservation score for Scaling is not 1 because of the size of the nodes that remains the same between the initial and the overlapping-free embeddings.
References
Barabaśi, A.L., Albert, R.: Emergence of scaling in random networks. Science 286(5439), 509–512 (1999)
Chimani, M., Gutwenger, C., Jünger, M., Klau, G.W., Klein, K., Mutzel, P.: The open graph drawing framework (OGDF). In: Tamassia, R. (ed.) Handbook on Graph Drawing and Visualization, pp. 543–569. Chapman and Hall/CRC, London (2013)
Dwyer, T., Marriott, K., Stuckey, P.J.: Fast node overlap removal. In: Healy, P., Nikolov, N.S. (eds.) GD 2005. LNCS, vol. 3843, pp. 153–164. Springer, Heidelberg (2006). https://doi.org/10.1007/11618058_15
Erdös, P., Rényi, A.: On random graphs. Publicationes Mathematicae Debrecen 6, 290–291 (1959)
Gansner, E., Hu, Y.: Efficient, proximity-preserving node overlap removal. J. Graph Algorithms Appl. 14(1), 53–74 (2010)
Gansner, E.R., North, S.C.: An open graph visualization system and its applications to software engineering. Softw. Pract. Exp. 30(11), 1203–1233 (2000)
Hachul, S., Jünger, M.: Drawing large graphs with a potential-field-based multilevel algorithm. In: Pach, J. (ed.) GD 2004. LNCS, vol. 3383, pp. 285–295. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-31843-9_29
Hayashi, K., Inoue, M., Masuzawa, T., Fujiwara, H.: A layout adjustment problem for disjoint rectangles preserving orthogonal order. In: Whitesides, S.H. (ed.) GD 1998. LNCS, vol. 1547, pp. 183–197. Springer, Heidelberg (1998). https://doi.org/10.1007/3-540-37623-2_14
Hu, Y.: Efficient, high-quality force-directed graph drawing. Math. J. 10(1), 37–71 (2005)
Huang, X., Lai, W.: Force-transfer: a new approach to removing overlapping nodes in graph layout. In: Proceedings of the 26th Australasian computer science conference, vol. 16, pp. 349–358. Australian Computer Society, Inc. (2003)
Huang, X., Lai, W., Sajeev, A., Gao, J.: A new algorithm for removing node overlapping in graph visualization. Inf. Sci. 177(14), 2821–2844 (2007)
Li, W., Eades, P., Nikolov, N.: Using spring algorithms to remove node overlapping. In: Proceedings of the 2005 Asia-Pacific Symposium on Information Visualisation, vol. 45, pp. 131–140. APVis 2005. Australian Computer Society Inc, Darlinghurst (2005)
Lyons, K.A., Meijer, H., Rappaport, D.: Algorithms for cluster busting in anchored graph drawing. J. Graph Algorithms Appl. 2(1), 1–24 (1998)
Marriott, K., Stuckey, P., Tam, V., He, W.: Removing node overlapping in graph layout using constrained optimization. Constraints 8(2), 143–171 (2003)
Misue, K., Eades, P., Lai, W., Sugiyama, K.: Layout adjustment and the mental map. J. Vis. Lang. Comput. 6(2), 183–210 (1995)
Nachmanson, L., Nocaj, A., Bereg, S., Zhang, L., Holroyd, A.: Node overlap removal by growing a tree. In: Hu, Y., Nöllenburg, M. (eds.) GD 2016. LNCS, vol. 9801, pp. 33–43. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-50106-2_3
Strobelt, H., Spicker, M., Stoffel, A., Keim, D., Deussen, O.: Rolled-out wordles: a heuristic method for overlap removal of 2D data representatives. Comput. Graph. Forum 31(3), 1135–1144 (2012)
Watts, D.J., Strogatz, S.H.: Collective dynamics of ‘small-world’ networks. Nature 393, 440–442 (1998)
Acknowledgement
This research has been partly funded by a national French grant (ANR Daphne 17-CE28-0013-01).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Chen, F., Piccinini, L., Poncelet, P., Sallaberry, A. (2019). Node Overlap Removal Algorithms: A Comparative Study. In: Archambault, D., Tóth, C.D. (eds) Graph Drawing and Network Visualization. GD 2019. Lecture Notes in Computer Science(), vol 11904. Springer, Cham. https://doi.org/10.1007/978-3-030-35802-0_14
Download citation
DOI: https://doi.org/10.1007/978-3-030-35802-0_14
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-35801-3
Online ISBN: 978-3-030-35802-0
eBook Packages: Computer ScienceComputer Science (R0)