Basic Matrix-Matrix • • R=R*E E+=E+ E 2 +. . + Ek Semiring applies as well Until fixpoint or max path length k
Relational Algebra
Time complexity merge sort • Matrix-vector: O(n log n) • Matrix-matrix: – O(m log m) if m=O(f(n)) not assumed – from O(n) to O(n 3) – clique of size K=O(n)
Fast algorithm termination immediate fixpoint
Matrix-matrix: Time complexity • Tree • Complete graph
Hardness of Matrix-Matrix multiplication
Parallel processing • Matrix-vector – Partition S – replicate S • Matrix-matrix, consider edge (i, j) – Partition by source vertex i: neighbors are local – Partition by destination vertex j: neighbors are local – Partition by edge i, j: neighbors not local
Conclusions • Unified two families of graph algorithms • Relational algebra expressions to evaluate matrix and matrix-vector multiplication • Characterize O() and speedup assuming sparse or dense adjacency matrix