GABB18 Paper 5
GABB18 Paper 5
a larger collection of implementations. We analyze drawing Figure 1. Drawings of a small graph with four vertices and four edges.
quality and performance tradeoffs with these approaches. The drawing in (a) uses the default layout algorithm in Graphviz v2.38.
The drawing in (b) is based on an algorithm discussed in this paper. The
drawing in (c) uses two eigenvectors of the Laplacian matrix corresponding
to the graph.
1. Introduction
We evaluate the graph drawing implementations on a In Table 2, we report on the performance of Koren’s
collection of sparse graphs. Table 1 lists some of the graphs algorithm without any speedup heuristics. For the last five
we experimented with. Most of these graphs are taken graphs listed in the table, we use a tolerance of 1e-5 because
from the SuiteSparse matrix collection [15]. Our drawings of slow convergence. We report overall time in seconds,
can be compared with Yifan Hu’s visualizations (available including file I/O, memory allocation, and initialization
at http://yifanhu.net/GALLERY/GRAPHS/) based on the costs. We also report the aggregate times for computing the
TABLE 1. T HE COLLECTION OF UNDIRECTED GRAPHS ( SYMMETRIC in Figure 2. As we can observe with Figure 3b, if the
SPARSE MATRICES ) USED IN THIS STUDY. T HE NUMBER OF VERTICES threshold is raised higher, warping effect gets more acute.
(n), NUMBER OF EDGES (m), AND SOURCE ARE GIVEN .
It is difficult to identity beforehand when the graph drawing
may be warped, and so we had to experiment with a large
Graph n m Source
collection of tolerance values, before settling on the defaults
grid6400 6400 12 640 own used in this work.
crack 10 240 30 380 [15]
4elt 15 606 45 878 [3]
finance256 37 376 130 560 [15] 4.4. Impact of Coarsening and HDE
oilpan 73 752 1 761 718 [15]
apache1 80 800 230 692 [15]
filter3D 106 437 1 300 371 [15] In Table 3, we present the running time overhead of
para-5 155 924 2 630 217 [15] just the initialization strategies. Instead of starting from
d pretok 182 730 756 256 [15] random vectors, we can use projected coarsened coordinates
turon m 189 924 778 531 [15] or HDE initialization. The time taken to compute projected
mario002 389 874 933 557 [15]
pa2010 421 545 1 029 231 [15] coarsened coordinates is in general very low, but for some
ecology1 1 000 000 1 998 000 [15] graphs, such as mario002 and pa2010, the time is very high.
G3 circuit 1 585 478 3 037 674 [15] This is because of the stringent tolerance criterion (1e-7)
kkt power 2 063 494 6 482 320 [15] used to assess convergence when using the coarser graph.
On the other hand, HDE initialization is relatively fast for
all graphs, because eigenvector computation is performed
two leading eigenvectors. It is immediately apparent that on a tiny graph.
the eigenvector computation time is the main contributor to In Table 4, we present the performance, running time
the overall time. The times reported are for 24-thread runs, improvement, and iteration counts of Algorithm 1, if ini-
and so we also report speedup based on the times obtained tialized with projected coarsened coordinates. To compute
with a single-threaded run. Finally, we list the number of second eigenvector, we achieve speedups ranging from 1.4×
loop iterations required to satisfy the desired tolerance, and to 988×. The iteration count drops if the projected coarsened
compute a per-iteration performance rate, by normalizing graph coordinates are used. For instance, filter3D requires
running time by number of edges. Inspecting this Table by 152 426 iterations to compute second eigenvector with ran-
column, it is unsurprising that the graph size is correlated dom initialization, but requires only 16 602 iterations when
with running time. The two largest graphs by vertex count initialized with projected coarsened graph coordinates. We
also take the longest time to finish. observe similar results for computing the third eigenvector
Observe that the 24-core parallel speedup is relatively as well.
low. This may be because of the small matrix sizes and Figure 4 shows two different drawings of the 4elt input,
OpenMP overheads in matrix-vector multiplication. Now both using Algorithm 1 for refinement, but with different
that we have a reference implementation, we can optimize initialization strategies. We observe that these drawings are
performance by substituting a tuned sparse matrix-vector nearly identical to the drawing with random initialization.
multiplication routine. Speedup also appears to be correlated
with average vertex degree and is higher for denser graphs.
The number of iterations required varies from input to 4.5. Performance of Fast Variants
input, and is dependent on the ratio of the eigenvalues and
the quality of our initial random estimate. filter3D has the In Table 6, we present the performance of a variant of
largest iteration count for the second eigenvector, but with Algorithm 4, with HDE initialization and Weighted Centroid
the caveat that we used a higher threshold for the last five smoothing Algorithm 2. We see that the time taken to
graphs. 4elt was a particularly challenging input and the compute drawings is considerably smaller, and the speedups
residual for the third eigenvector briefly shows an increasing range from 22× for small graphs to 130× for larger graphs.
trend, before again reducing. As we see next, the quality of the drawing computed with
Inspecting the rate provides more insight into perfor- this algorithm is almost similar for small graphs and better
mance and room for improvement. The rate varies as much for larger graphs.
as 10× from input to input. It is highest for the graph
with the largest m/n ratio, suggesting that the sparse matrix 4.6. Drawing Quality
vector multiply operations offset any overhead due to non-
parallelization of the orthogonalization-related steps. In Figure 5, we compare the drawings computed using
the exact method described in Algorithm 1 and the ap-
4.3. Sensitivity to default parameters proximate variant using HDE along with Weighted Centroid
smoothing described in Algorithm 2. In general, we observe
In Figure 3, we observe a warping effect when the that HDE with weighted centroid smoothing computes good
threshold for convergence in Algorithm 1 is set higher than global layouts, i.e., no warping effects in the drawing. The
the default threshold parameter of 1e-6. In Figure 3a, notice details are also preserved well. On the other hand, exact
that the drawing for 4elt is not as smooth as the drawing Algorithm 1, computes locally smoother drawings, but can
inant degree-normalized eigenvectors. We find that we need
to compute the vectors to a high degree of accuracy in order
to generate aesthetically-pleasing layouts. An extremely fast
heuristic works surprisingly well. We also observe different
algorithmic variants highlighting different features of the
graph in the layout.
We foresee a number of directions for future research.
An immediate goal would be to extend the evaluation and
make it more comprehensive, along the lines of Hu’s graph
(a) eps = 5 × 10−5 visualization gallery. Identifying good defaults to use for
various parameters is another short-term goal. Finally, we
want to explore parallel performance and scalability bottle-
necks in greater depth.
There are several closely-related problems areas where
we can directly use the computed degree-normalized eigen-
values. Graph embedding and partitioning problems are the
most promising avenues.
Acknowledgments
(b) eps = 10−4
This work is supported by the US National Science
Figure 3. The drawing quality is sensitive to the convergence threshold used Foundation grant #1253881. This work used the Extreme
in our algorithm. We give drawings for the 4elt input with two different
eps settings. These can be compared to the drawing in Figure 2, which Science and Engineering Discovery Environment (XSEDE),
uses the default tolerance value. which is supported by National Science Foundation grant
number ACI-1548562.
References
[1] Y. Koren, “Drawing graphs by eigenvectors: theory and practice,”
Computers & Mathematics with Applications, vol. 49, no. 11, pp.
1867–1888, 2005.
[2] K. M. Hall, “An r-dimensional quadratic placement algorithm,” Man-
agement science, vol. 17, no. 3, pp. 219–229, 1970.
[3] C. Walshaw, “Walshaw’s graph partitioning archive,” 2016, http:
(a) Coarsening
//chriswalshaw.co.uk/partition, last accessed Feb 2018.
[4] H. Cai, V. W. Zheng, and K. C. Chang, “A comprehensive survey
of graph embedding: Problems, techniques and applications,” 2017,
arXiv preprint abs/1709.07604.
[5] S. Kirmani and P. Raghavan, “Scalable parallel graph partitioning,”
in Proc. Int’l. Conf. on high performance computing, networking,
storage and analysis (SC), 2013.
[6] M. Filippone, F. Camastra, F. Masulli, and S. Rovetta, “A survey
of kernel and spectral methods for clustering,” Pattern Recognition,
vol. 41, no. 1, pp. 176–190, 2008.
[7] S. White and P. Smyth, “A spectral clustering approach to finding
(b) HDE
communities in graphs,” in Proc. SIAM Int’l. Conf. on Data Mining
Figure 4. Drawings of the 4elt graph when using initialized vectors from (SDM), 2005.
coarsening and HDE. [8] G. Guennebaud, B. Jacob et al., “Eigen v3,”
http://eigen.tuxfamily.org, 2010.
suffer from warping effects when the graphs are large with [9] D. Spielman, “Spectral graph theory,” in Combinatorial Scientific
Computing, U. Naumann and O. Schenk, Eds. CRC Press, 2012,
large convergence thresholds. For smaller graphs, such as ch. 18.
crack, finance256, oilpan, etc. we can observe that using
[10] J. Shi and J. Malik, “Normalized cuts and image segmentation,” IEEE
Algorithm 1 alone computes more symmetric drawings. Transactions on Pattern Analysis and Machine Intelligence, vol. 22,
no. 8, pp. 888–905, 2000.
5. Conclusions and Future Work [11] W. T. Tutte, “How to draw a graph,” Proc. London Mathematical
Society, vol. 3, no. 1, pp. 743–767, 1963.
This work presents a number of spectral graph drawing [12] D. Harel and Y. Koren, “Graph drawing by high-dimensional embed-
algorithmic variants, all focused on computing the two dom- ding,” in Proc. Int’l. Symp. on Graph Drawing, 2002.
m
TABLE 2. P ERFORMANCE OF THE ‘ EXACT ’ APPROACH ( WITHOUT COARSENING OR HDE). R ATE IS CALCULATED AS 1e6∗t∗c
. N UMBERS
EMPHASIZED IN BOLD FONT ARE DISCUSSED IN THE PAPER .
TABLE 3. T HE TIME TAKEN FOR COARSENING AND HDE WITH TABLE 5. P ERFORMANCE OF THE EIGENVECTOR COMPUTATION STEPS
DEFAULT SETTINGS . N OTE THAT THESE TIMES INCLUDE EIGENVECTOR USING THE HDE VECTORS FOR INITIALIZATION .
COMPUTATION FOR THE SMALLER GRAPH .
Second eigenvector Third eigenvector
Graph
Time (s) Time (s) Speedup Iter c Time (s) Speedup Iter c
Graph
Coarsening HDE
grid6400 0.6 2.6 3335 0.5 4.2 2777
grid6400 0.44 0.19 crack 4.1 2.3 13 263 4.4 0.8 13 353
crack 0.29 0.13 4elt 12.7 0.9 36 260 7.5 2.5 22 181
4elt 0.34 0.12 finance256 8.0 1.5 16 969 6.4 1.6 13 854
finance256 0.70 0.14 oilpan 23.2 4.8 16 404 19.1 1.5 12 890
oilpan 0.35 0.19 apache1 7.3 4.7 7133 6.4 3.2 5660
apache1 0.24 0.15 filter3D 205.8 0.9 168 588 11.5 2.8 8347
filter3D 1.88 0.13 para-5 126.8 0.7 45 136 87.9 0.8 28 084
para-5 0.60 0.29 d pretok 50.3 1.7 23 741 179.8 0.8 82 147
d pretok 0.10 0.24 turon m 56.7 4.1 25 949 37.5 3.1 15 282
turon m 0.12 0.24 mario002 165.3 1.0 38 168 70.7 2.2 13 480
mario002 388.69 0.41 pa2010 309.6 0.7 65 791 208.5 0.5 36 194
pa2010 129.19 0.45 ecology1 256.5 3.7 19 192 62.3 5.2 4172
ecology1 5.34 0.70 kkt power 490.5 1.2 15 734 568.4 1.5 15 586
kkt power 28.80 2.88
[13] C. Chevalier and I. Safro, “Comparison of coarsening schemes for 2009, pp. 191–205.
multilevel graph partitioning,” in Learning and Intelligent Optimiza-
tion, T. Stützle, Ed. Berlin, Heidelberg: Springer Berlin Heidelberg, [14] G. Karypis and V. Kumar, “A fast and high quality multilevel scheme
(a) grid6400 (b) crack (c) 4elt
for partitioning irregular graphs,” SIAM Journal on Scientific Com- ematica Journal, vol. 10, no. 1, pp. 37–71, 2005.
puting, vol. 20, no. 1, pp. 359–392, 1998, http://glaros.dtc.umn.edu/
[17] J. Towns, T. Cockerill, M. Dahan, I. Foster, K. Gaither, A. Grimshaw,
gkhome/fsroot/sw/metis/OLD, last accessed Feb 2018.
V. Hazlewood, S. Lathrop, D. Lifka, G. D. Peterson, R. Roskies,
[15] T. A. Davis and Y. Hu, “The University of Florida sparse matrix col- J. R. Scott, and N. Wilkins-Diehr, “XSEDE: Accelerating scientific
lection,” ACM Trans. Math. Softw., vol. 38, no. 1, pp. 1–25, 2011, http: discovery,” Computing in Science & Engineering, vol. 16, no. 5, pp.
//faculty.cse.tamu.edu/davis/matrices.html, last accessed Feb 2018. 62–74, 2014.
[16] Y. Hu, “Efficient, high-quality force-directed graph drawing,” Math-