Skip to content

Accelerate add edges for large graphs #1410

@kilianvolmer

Description

@kilianvolmer

Motivation / Current Behaviour

When using a few thousand edges in a graph, the graph generation process takes a long time. E.g. for 1.6 million edges, I measured 4.5e+03 seconds.

Enhancement description

The edges are always sorted and inserted into the correct location in the edge vector.
It can be faster to just push all edges to this vector, then sort it and finally remove duplicates. E.g. for 1.6 million edges, O measured 9.6e-01 seconds.

Additional context

No response

Checklist

  • Attached labels, especially loc:: or model:: labels.
  • Linked to project

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

👀 Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions