GraphBLAS / LAGraph

This is a library plus a test harness for collecting algorithms that use the GraphBLAS. For test coverage reports, see https://graphblas.org/LAGraph/ . Documentation: https://lagraph.readthedocs.org
Other
229 stars 61 forks source link

Optimize LCC algorithm #16

Closed szarnyasg closed 5 years ago

szarnyasg commented 5 years ago

Optimize LCC based on the observation that the lower triangle of A+A' (defined on a real semiring), i.e. L = tril(A+A'), is sufficient to compute the number of triangles for each vertex and results in significantly more spares matrices. Using this, instead of CA<C>=C*A we now compute CL<C>=C*L.

The code now distinguishes between symmetric and unsymmetric matrices (corresponding to undirected and directed graphs, respectively) as they need to be treated differently when determining the maximum possible number of edges between neighbors.