Faster Fully Dynamic Transitive Closure in Practice Kathrin Hanauer - - PowerPoint PPT Presentation

faster fully dynamic transitive closure in practice
SMART_READER_LITE
LIVE PREVIEW

Faster Fully Dynamic Transitive Closure in Practice Kathrin Hanauer - - PowerPoint PPT Presentation

Faster Fully Dynamic Transitive Closure in Practice Kathrin Hanauer Monika Henzinger Christian Schulz June 17, 2020 kathrin.hanauer@univie.ac.at All-Pairs Reachability a.k.a. Transitive Closure Fully Dynamic Transitive Closure directed


slide-1
SLIDE 1

Faster Fully Dynamic Transitive Closure in Practice

Kathrin Hanauer Monika Henzinger Christian Schulz June 17, 2020

kathrin.hanauer@univie.ac.at

slide-2
SLIDE 2

Reachability All-Pairs

a.k.a.

Transitive Closure

Fully Dynamic Transitive Closure directed graph + sequence of operations: queries s

?

t edge insertions & deletions

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-3
SLIDE 3

THEORY PRACTICE

TRANSITIVE CLOSURE FULLY DYNAMIC

Query Update m 1

static graph traversal

1 n2

[DI08, Rod08, San04]

√n m√n

[RZ08]

m0.43 m0.58n

[RZ08]

n0.58 n1.58

[San04]

n1.495 n1.495

[San04]

n m + n log n

[RZ16]

n1.407 n1.407

[vdBNS19]

& Times (in O) 2 Very Large Studies [FMNZ01, KZ08] Distinctly fastest on most instances: static graph traversal algorithms Strongest competitors: two SCC-maintaining algorithms Few “real-world” graphs Our Idea Engineering algorithms that . . . use single-source reachability don’t maintain SCCs profit from SCCs

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-4
SLIDE 4

Supportive Vertices

Observations

Let v, s, t be vertices. R+(v)/R−(v): vertices reachable from/that can reach v Consider query s

?

t:

v

R−(v) R+(v)

s t v

R−(v) R+(v)

s t

(O1)

v

R−(v) R+(v)

s t v

R−(v) R+(v)

s t

(O2)

v

R−(v) R+(v)

t s v

R−(v) R+(v)

t s

(O3) v is a supportive vertex: R+(v)/R−(v) can help to answer s

?

t

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-5
SLIDE 5

Supportive Vertices Algorithms

General Outline

◮ Store list of supportive vertices LSV ∀v ∈ LSV: maintain R+(v) and R−(v) via SSR; algorithms ◮ Updates (edge insertions & deletions): forward to SSR algorithms ◮ Query: ∀v ∈ LSV: try to answer via (O1), (O2), (O3) fallback to static graph traversal single-source/ single-sink reachability

v R−(v) R+(v) s t

(O1)

v R−(v) R+(v) s t

(O2)

v R−(v) R+(v) t s

(O3)

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-6
SLIDE 6

Supportive Vertices Algorithms

SV(k) SVA(k, c)

with adjustments

SVC(z, c)

with SCC cover

compute SCCs {S0, . . . , Sℓ} if |Si| ≥ z: pick supportive vertex for Si as representative map: vertex → representative pick k vertices as supportive vertices uniformly at random

Initialization:

re-initialize every c updates

Updates:

lookup & use representatives remove invalid entries from map fallback: mode of SV/SVA try supportive vertices in order of LSV fallback: static graph traversal

Queries:

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-7
SLIDE 7

Single-Source Reachability Subalgorithms

Extended Simple Incremental Algorithm (SI)

Maintains reachability tree: Insertions: extend tree via BFS Deletions: reconstruct tree via backward/forward BFS Queries: O(1) time

s v

Simplified Extended Even-Shiloach Trees (SES)

Maintains BFS tree: Insertions: update BFS levels Deletions: simplified ES tree routine Queries: O(1) time

s v

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-8
SLIDE 8

Experiments

All algorithms implemented in C++17 as part

  • f the open-source algorithms library Algora.

Algora Code available publicly on Gitlab & Github: libAlgora libAlgora

Algorithms

◮ BFS, DFS, DBFS (DFS-BFS hybrid) ◮ BiBFS (bidirectional BFS) ◮ SV with k = 1, k = 2, k = 3 ⋆ ◮ SVA with k = 1 and c = 1k, c = 10k, c = 100k ⋆ ◮ SVC with z = 25 or z = 50 and c = 10k, c = 100k ⋆

⋆ Fallback: BiBFS; SSR algorithms: SES, SI [HHS20]

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-9
SLIDE 9

Experiments: Instances

Random dynamic instances

ER graphs: n = 100k and n = 10m, minit = d · n, d ∈ [1.25 . . . 50] σ = 100k, different ratios of insertions/deletions/queries Stochastic Kronecker graphs with random update sequences: n ≈ 130k and n ≈ 30 . . . 130k, mavg = d · n, d = 0.7 . . . 16.5 σ± = 1.6m . . . 702m and σ± = 282k . . . 82m (updates only)

Real-world dynamic instances

. . . with real-world update sequences: n = 100k . . . 2.2m, mavg = d · n, d = 5.4 . . . 7.8 σ± = 1.6m . . . 86.2m (updates only) . . . with randomized update sequences: n = 31k . . . 2.2m, mavg = d · n, d = 4.7 . . . 10.4 σ± = 1.4m . . . 76.4m (updates only)

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-10
SLIDE 10

Experiments: Random Instances

n = σ = 100k, ρIDQ = 1 : 1 : 1

1.25 2.5 5 10 20 40 0.1 1 10 SV(1) SVC(25,∞) SV(2) SV(3) SVC(25,10k) SVA(1,10k) SVA(1,1k)

Density d Mean total update time (s)

1.25 2.5 5 10 20 40 0.1 1 10 100 1 000 BiBFS BFS DFS/DBFS SVC SV(1) SVA

Density d Mean total query time (s)

1.25 2.5 5 10 20 40 0.1 1 10 100 1 000 BiBFS BFS DFS/DBFS SVC(25,∞) SV(1) SVA(1,1k) SVA(1,10k) SVC(25,10k) SV(3)

Density d Mean total operation time (s)

1.25 2.5 5 10 20 40 1 10 100 1 000 10 000 BiBFS BFS DFS/DBFS SVA(1,1k) SVA(1,10k) SVC(25,10k) SV(3)

SV(1)

SVC(25,∞)

Density d Mean operation time, relative to SVC(25,∞)

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-11
SLIDE 11

Experiments: Random Instances

n = σ = 100k, ρIDQ = 1 : 1 : 2 | n = 10m, σ = 100k, ρIDQ = 1 : 1 : 1

1.25 2.5 5 10 20 40 0.1 1 10 SVA(1,1k) BiBFS SVA(1,10k) SVC(25,10k) SVC(25,∞) SV(1) SV(3)

Density d Mean total operation time (s)

1.25 2.5 5 10 20 40 10 100 1 000 SVA(1,1k) SVA(1,10k) BiBFS SVC(50,10k) SV(3) SVC(50,∞) SV(1)

Density d Mean total operation time (s)

1.25 2.5 5 10 20 40 1 10 100 SVA(1,1k) BiBFS SVA(1,10k) SVC(25,10k) SV(3)

SV(1)

SVC(25,∞)

Density d Mean operation time, relative to SVC(25, ∞)

1.25 2.5 5 10 20 40 1 10 100 BiBFS SVA(1,1k) SVA(1,10k) SVC(25,10k) SV(3)

SV(1)

SVC(25,∞)

Density d Mean operation time, relative to SVC(50, ∞)

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-12
SLIDE 12

Experiments: Kronecker Instances

n ≈ 130k, σ± = 1.6m . . . 702m, ρUQ = 2 : 1

Timeout (30 min)

answers bio-proteins blog-nat05-6m ca-dblp email-inside gnutella-25

23s 5min 42s 13min 50s 9min 19s 2min 34s 4min 11s 5min 34s 4min 41s 14min 30s 1min 46s 41s 1min 45s 2min 34s 3min 12s 24min 3s 1min 46s 53s 7min 59s 22min 19s 9min 25s 2min 48s 31s 3min 32s 6min 41s 4min 12s 1min 55s 1min 4s 5min 5s 13min 35s 5min 32s 2min 20s 32s 1min 26s 2min 40s 1min 46s 1min

SVC(25, 100k) SVC(25, 10k) SVA(1, 100k) SVA(1, 10k) SV(2) SV(1) BiBFS

Fastest: SV(1), SV(2), SVC(25,100k) BFS, DFS, DBFS: > 6 h on ≥ 13/20 instances similar picture for n ≈ 30 . . . 130k

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-13
SLIDE 13

Experiments: Real-World Instances

n = 31k . . . 2.2m, σ± = 1.6m . . . 86.2m, ρUQ = 2 : 1

Timeout (24h)

DE FR IT NL PL SIM

2h 31min 6h 54min 4h 44min 1h 43min 50min 22s 1h 1min 31s 4h 44min 2h 1min 37min 43s 53min 29s 28min 22s 14s 4h 25min 3h 46min 59min 36s 17min 46s 22min 26s 23s 21h 41min 13h 9min 4h 42min 1h 42min 2h 16min 37s 7h 40min 6h 57min 1h 47min 42min 41s 51min 14s 24s 15h 41min 8h 29min 3h 30min 1h 18min 2h 10min 30s 5h 24min 3h 24min 1h 12min 30min 50s 46min 52s 11s

SVC(50, 100k) SVC(50, 10k) SVA(1, 100k) SVA(1, 10k) SV(2) SV(1) BiBFS DFS

Fastest: SV(1), SV(2) BFS, DFS, DBFS: ≈ 6 % in 24 h on DE instance similar picture on set with randomized updates

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-14
SLIDE 14

Conclusion

1 2 3

SV(1) SV(2) SVC(*,100k)

+ more stable query time – doubled update time + more stable query time + fast on sparse instances – – considerably increased update time ?? recompute less often

Slower by several orders of magnitude: BFS, DFS, DBFS, BiBFS

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-15
SLIDE 15

Thank you! – Questions?

Supportive Vertices

Observations Let v, s, t be vertices. R+(v)/R−(v): vertices reachable from/that can reach v Consider query s

?

t:

v R−(v) R+(v) s t v R−(v) R+(v) s t

(O1)

v R−(v) R+(v) s t v R−(v) R+(v) s t

(O2)

v R−(v) R+(v) t s v R−(v) R+(v) t s

(O3) v is a supportive vertex: R+(v)/R−(v) can help to answer s

?

t

Experiments: Random Instances

n = σ = 100k, ρIDQ = 1 : 1 : 1

1.25 2.5 5 10 20 40 0.1 1 10 SV(1) SVC(25,∞) SV(2) SV(3) SVC(25,10k) SVA(1,10k) SVA(1,1k)

Density d Mean total update time (s)

1.25 2.5 5 10 20 40 0.1 1 10 100 1 000 BiBFS BFS DFS/DBFS SVC SV(1) SVA

Density d Mean total query time (s)

1.25 2.5 5 10 20 40 0.1 1 10 100 1 000 BiBFS BFS DFS/DBFS SVC(25,∞) SV(1) SVA(1,1k) SVA(1,10k) SVC(25,10k) SV(3)

Density d Mean total operation time (s)

1.25 2.5 5 10 20 40 1 10 100 1 000 10 000 BiBFS BFS DFS/DBFS SVA(1,1k) SVA(1,10k) SVC(25,10k) SV(3) SV(1)

SVC(25,∞)

Density d Mean operation time, relative to SVC(25,∞)

Conclusion

1 2 3

SV(1) SV(2) SVC(*,100k)

+ more stable query time – doubled update time + more stable query time + fast on sparse instances – – considerably increased update time ?? recompute less often Slower by several orders of magnitude: BFS, DFS, DBFS, BiBFS

Dynamic instances & source code:

https://dyreach.taa.univie.ac.at/ transitive-closure

Algora

libAlgora libAlgora

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-16
SLIDE 16

Bibliography I

[DI08]

  • C. Demetrescu and G. F. Italiano. Mantaining dynamic matrices for

fully dynamic transitive closure. Algorithmica, 51(4):387–427, 2008. [FMNZ01] D. Frigioni, T. Miller, U. Nanni, and C. Zaroliagis. An experimental study of dynamic algorithms for transitive closure. Journal of Experimental Algorithmics (JEA), 6:9, 2001. [HHS20]

  • K. Hanauer, M. Henzinger, and C. Schulz. Fully dynamic

single-source reachability in practice: An experimental study. In Proceedings of the Symposium on Algorithm Engineering and Experiments, ALENEX 2020, Salt Lake City, UT, USA, January 5-6, 2020, pages 106–119, 2020. [KZ08]

  • I. Krommidas and C. D. Zaroliagis. An experimental study of

algorithms for fully dynamic transitive closure. ACM Journal of Experimental Algorithmics, 12:1.6:1–1.6:22, 2008. [Rod08]

  • L. Roditty. A faster and simpler fully dynamic transitive closure.

ACM Trans. Algorithms, 4(1), March 2008.

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice

slide-17
SLIDE 17

Bibliography II

[RZ08]

  • L. Roditty and U. Zwick. Improved dynamic reachability algorithms

for directed graphs. SIAM Journal on Computing, 37(5):1455–1471, 2008. [RZ16]

  • L. Roditty and U. Zwick. A fully dynamic reachability algorithm for

directed graphs with an almost linear update time. SIAM Journal

  • n Computing, 45(3):712–733, 2016.

[San04]

  • P. Sankowski. Dynamic transitive closure via dynamic matrix
  • inverse. In 45th Symposium on Foundations of Computer Science

(FOCS), pages 509–517. IEEE, 2004. [vdBNS19] J. van den Brand, D. Nanongkai, and T. Saranurak. Dynamic matrix inverse: Improved algorithms and matching conditional lower bounds. In 60th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2019, Baltimore, Maryland, USA, November 9-12, 2019, pages 456–480, 2019.

Kathrin Hanauer Faster Fully Dynamic Transitive Closure in Practice