Skip to content

Performance optimization related to priority queue #76

@yuewuo

Description

@yuewuo

We use a priority queue for the search stage (growing all the clusters simultaneously), by learning how Sparse Blossom (PyMatching v2) achieves a faster speed than fusion blossom.

Recently I took a closer look at PyMatching's implementation (and got amazed how well their code is structured, which I hope to learn in the future). It turns out that for each vertex, they only add the most recent event from incident edges to the queue. Our current implementation, instead, adds all the future events of all incident edges to the queue. The former adds way less events (>10x) to the queue while still achieving the same effect, so we should definitely learn that.

Credit to Chen Zhao who helped me spot this inefficiency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions