Skip to content

[FEA] Optimize collapse #337

Description

@lmeyerov

Is your feature request related to a problem? Please describe.

Current collapse code is slow on big graphs, e.g., seconds/minutes 1K-100K edges

Describe the solution you'd like

  • closer to O(n logn) asymptotics (for # nodes + # edges), such as O(n d^2) where d is the longest collapsed path
  • vectorized
  • avoid current re-running per kv pair
  • decompose into general primitives

Some thoughts:

  • do marking phase:
    • identify nodes by collapse group id: same match + adjacent
    • handle all equiv classes at same time
    • ex: pregel-style propagation alg, running to fixpoint (d iterations)
    • classify edges as remaining vs reduction group (start equiv class -> end equiv class)
  • do a separate collapsing (reductions) phase to aggregate matches
    • collapse matched nodes, + compute any desired aggregates
    • collapse edges, + compute any desired aggregates
  • do a separate rewiring

Ideally do various phases as reusable & swappable standalone primitives. E.g., look at #193 .

Activity

  1. lmeyerov commented on Apr 23, 2022

    @lmeyerov
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions