Faster Force-Directed Graph Drawing with the Well-Separated Pair - - PowerPoint PPT Presentation
Faster Force-Directed Graph Drawing with the Well-Separated Pair - - PowerPoint PPT Presentation
Faster Force-Directed Graph Drawing with the Well-Separated Pair Decomposition Fabian Lipp Alexander Wolff Johannes Zink Julius-Maximilians-Universitt Wrzburg September 24, Graph Drawing 2015 Introduction Classical force-directed
Introduction
Classical force-directed algorithm [Eades, 1984, Fruchterman & Reingold, 1991] Attracting forces: O(m) time with m = #edges Repulsive forces: Θ(n2) time with n = #vertices
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 1 / 11
Introduction
Classical force-directed algorithm [Eades, 1984, Fruchterman & Reingold, 1991] Attracting forces: O(m) time with m = #edges Repulsive forces: Θ(n2) time with n = #vertices Many speed-up techniques for force-directed algorithms known: Hierarchical O(n log n) force-calculation [Barnes & Hut, 1986] Potential-field-based multilevel algorithm [Hachul & Jünger, 2005] Evaluation of multilevel layout methods [Bartel et al., 2011]
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 1 / 11
Introduction
Classical force-directed algorithm [Eades, 1984, Fruchterman & Reingold, 1991] Attracting forces: O(m) time with m = #edges Repulsive forces: Θ(n2) time with n = #vertices Many speed-up techniques for force-directed algorithms known: Hierarchical O(n log n) force-calculation [Barnes & Hut, 1986] Potential-field-based multilevel algorithm [Hachul & Jünger, 2005] Evaluation of multilevel layout methods [Bartel et al., 2011] Our approach Using well-separated pair decomposition to speed up repulsive force calculation to O(n log n) time. Can be combined with other speed-up techniques.
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 1 / 11
Well-Separated Pairs
A B Definition Let s > 0. A and B in R2 are s-well-separated iff there are two balls CA and CB with A ⊆ CA and B ⊆ CB, radius r := r(CA) = r(CB), and distance ≥ s · r. [Callahan & Kosaraju, 1995]
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 2 / 11
Well-Separated Pairs
CA CB A B Definition Let s > 0. A and B in R2 are s-well-separated iff there are two balls CA and CB with A ⊆ CA and B ⊆ CB, radius r := r(CA) = r(CB), and distance ≥ s · r. [Callahan & Kosaraju, 1995]
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 2 / 11
Well-Separated Pairs
CA CB r r A B Definition Let s > 0. A and B in R2 are s-well-separated iff there are two balls CA and CB with A ⊆ CA and B ⊆ CB, radius r := r(CA) = r(CB), and distance ≥ s · r. [Callahan & Kosaraju, 1995]
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 2 / 11
Well-Separated Pairs
CA CB r r ≥ s · r A B Definition Let s > 0. A and B in R2 are s-well-separated iff there are two balls CA and CB with A ⊆ CA and B ⊆ CB, radius r := r(CA) = r(CB), and distance ≥ s · r. [Callahan & Kosaraju, 1995]
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 2 / 11
Well-Separated Pairs
CA CB r r ≥ s · r A B Definition Let s > 0. A and B in R2 are s-well-separated iff there are two balls CA and CB with A ⊆ CA and B ⊆ CB, radius r := r(CA) = r(CB), and distance ≥ s · r. [Callahan & Kosaraju, 1995]
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 2 / 11
Well-Separated Pair Decomposition (WSPD)
Definition Let S be a finite set in R2. A WSPD for S with respect to s > 0 is a sequence {A1, B1}, {A2, B2}, . . . , {Ak, Bk}
- f s-well-separated pairs Ai, Bi such
that Ai, Bi ⊆ S, and ∀a = b ∈ S there is exactly one i with a ∈ Ai and b ∈ Bi or vice versa.
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 3 / 11
Well-Separated Pair Decomposition (WSPD)
Definition Let S be a finite set in R2. A WSPD for S with respect to s > 0 is a sequence {A1, B1}, {A2, B2}, . . . , {Ak, Bk}
- f s-well-separated pairs Ai, Bi such
that Ai, Bi ⊆ S, and ∀a = b ∈ S there is exactly one i with a ∈ Ai and b ∈ Bi or vice versa.
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 3 / 11
Well-Separated Pair Decomposition (WSPD)
Definition Let S be a finite set in R2. A WSPD for S with respect to s > 0 is a sequence {A1, B1}, {A2, B2}, . . . , {Ak, Bk}
- f s-well-separated pairs Ai, Bi such
that Ai, Bi ⊆ S, and ∀a = b ∈ S there is exactly one i with a ∈ Ai and b ∈ Bi or vice versa.
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 3 / 11
Well-Separated Pair Decomposition (WSPD)
Definition Let S be a finite set in R2. A WSPD for S with respect to s > 0 is a sequence {A1, B1}, {A2, B2}, . . . , {Ak, Bk}
- f s-well-separated pairs Ai, Bi such
that Ai, Bi ⊆ S, and ∀a = b ∈ S there is exactly one i with a ∈ Ai and b ∈ Bi or vice versa.
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 3 / 11
Well-Separated Pair Decomposition (WSPD)
Definition Let S be a finite set in R2. A WSPD for S with respect to s > 0 is a sequence {A1, B1}, {A2, B2}, . . . , {Ak, Bk}
- f s-well-separated pairs Ai, Bi such
that Ai, Bi ⊆ S, and ∀a = b ∈ S there is exactly one i with a ∈ Ai and b ∈ Bi or vice versa.
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 3 / 11
Well-Separated Pair Decomposition (WSPD)
Definition Let S be a finite set in R2. A WSPD for S with respect to s > 0 is a sequence {A1, B1}, {A2, B2}, . . . , {Ak, Bk}
- f s-well-separated pairs Ai, Bi such
that Ai, Bi ⊆ S, and ∀a = b ∈ S there is exactly one i with a ∈ Ai and b ∈ Bi or vice versa.
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 3 / 11
Well-Separated Pair Decomposition (WSPD)
Definition Let S be a finite set in R2. A WSPD for S with respect to s > 0 is a sequence {A1, B1}, {A2, B2}, . . . , {Ak, Bk}
- f s-well-separated pairs Ai, Bi such
that Ai, Bi ⊆ S, and ∀a = b ∈ S there is exactly one i with a ∈ Ai and b ∈ Bi or vice versa.
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 3 / 11
Computation of WSPD
Theorem Let S be a set of n points in R2. For any s > 0, a WSPD consisting of O(n) pairs can be computed in O(n log n) time. [Callahan & Kosaraju, 1995]
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 4 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep Compute forces for Θ(n2) pairs of vertices
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
A B |B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
A B |B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Repulsive Force Calculation
|B| · Frep |A| · Frep Compute forces for k ∈ O(n) well-separated pairs
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 11
Using the Split Tree
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 6 / 11
Using the Split Tree
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 6 / 11
Using the Split Tree
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 6 / 11
Using the Split Tree
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 6 / 11
Using the Split Tree
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 6 / 11
Using the Split Tree
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 6 / 11
Running time
Compute the WSPD using a split tree O(n log n) Compute forces for every pair O(n) Propagate forces in the split tree O(n) Total O(n log n)
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 7 / 11
Experiments
Implementation in Java based on FRLayout in Jung (Java Universal Network/Graph Framework) Comparison to similar speed-up techniques: Quadtree based [Barnes & Hut, 1986] Grid variant [Fruchterman & Reingold, 1991]
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 8 / 11
Experiments: Running time
10 20 30 40 50 60 70 80 90 100 0.01 0.02 0.03 Number of vertices Running time in seconds FRLayout (JUNG) FR+Quad, Θ = 1.0 FR+Grid FR+WSPD, s = 0.1
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 9 / 11
Experiments: Quality
better 50 100 150 200 250 300 0.3 0.35 Number of edge crossings Standard deviation of edge length FRLayout (JUNG) FR+Quad, Θ = 1.0 FR+Grid FR+WSPD, s = 0.1
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 10 / 11
Experiments: Quality
better 50 100 150 200 250 300 0.3 0.35 Number of edge crossings Standard deviation of edge length FRLayout (JUNG) FR+Quad, Θ = 1.0 FR+Grid FR+WSPD, s = 0.1
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 10 / 11
Experiments: Quality
better 50 100 150 200 250 300 0.3 0.35 Number of edge crossings Standard deviation of edge length FRLayout (JUNG) FR+Quad, Θ = 1.0 FR+Grid FR+WSPD, s = 0.1
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 10 / 11
Experiments: Quality
better 50 100 150 200 250 300 0.3 0.35 Number of edge crossings Standard deviation of edge length FRLayout (JUNG) FR+Quad, Θ = 1.0 FR+Grid FR+WSPD, s = 0.1
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 10 / 11
Experiments: Quality
better 50 100 150 200 250 300 0.3 0.35 Number of edge crossings Standard deviation of edge length FRLayout (JUNG) FR+Quad, Θ = 1.0 FR+Grid FR+WSPD, s = 0.1
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 10 / 11
Summary
Asymptotic running time of O(n log n) for each iteration Notably faster than unmodified algorithm Similar to unmodfied algorithm in terms of quality Better quality than Grid variant of Fruchterman & Reingold
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 11 / 11
Summary
Asymptotic running time of O(n log n) for each iteration Notably faster than unmodified algorithm Similar to unmodfied algorithm in terms of quality Better quality than Grid variant of Fruchterman & Reingold Demonstration during the poster session this afternoon
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 11 / 11
Summary
Asymptotic running time of O(n log n) for each iteration Notably faster than unmodified algorithm Similar to unmodfied algorithm in terms of quality Better quality than Grid variant of Fruchterman & Reingold Demonstration during the poster session this afternoon Thank you!
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 11 / 11
APPENDIX
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 1 / 7
Example drawings
FRLayout (JUNG) FR+WSPD, s = 0.1
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 2 / 7
Example drawings
FRLayout (JUNG) FR+WSPD, s = 0.1
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 3 / 7
Experiments: Running time on large graphs
20,000 40,000 60,000 80,000 100,000 50 100 150 Number of vertices Running time in seconds FRLayout (JUNG) FR+Quad, Θ = 1.0 FR+Grid FR+WSPD, s = 0.1
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 4 / 7
Experiments: Running times compared to OGDF
10 20 30 40 50 60 70 80 90 100 0.01 0.02 0.03 Number of vertices Running time in seconds FRLayout (JUNG) FRExact (OGDF) FR+Grid FM3 (OGDF) FR+Quad, Θ = 1.0 FM3 single (OGDF) FR+WSPD, s = 0.1 GEM (OGDF)
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 5 / 7
Experiments: Running times compared to OGDF
20,000 40,000 60,000 80,000 100,000 50 100 150 Number of vertices Running time in seconds FRLayout (JUNG) FRExact (OGDF) FR+Grid FM3 (OGDF) FR+Quad, Θ = 1.0 FM3 single (OGDF) FR+WSPD, s = 0.1 GEM (OGDF)
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 6 / 7
Experiments: Quality compared to OGDF
50 100 150 200 250 300 0.3 0.35 Number of edge crossings Standard deviation of edge length FR+WSPD, s = 0.1 FM3 (OGDF) GEM (OGDF) FRExact (OGDF) FM3 single (OGDF)
Fabian Lipp, Alexander Wolff, Johannes Zink Force-Directed Graph Drawing with WSPD 7 / 7