Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce graph InEdges & OutEdges methods #183

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

atzoum
Copy link

@atzoum atzoum commented Nov 12, 2024

Up to now, if one was interested in getting all edges of a source or target, there used to be two options:

  • Use the Edges method and filter the result based on source/target.
  • Use the AdjacencyMap/PredecessorMap method, select the appropriate key and transform the map into a slice

Both of these options have proved to be quite inefficient for very big graphs, e.g. with millions of edges.

Therefore we are introducing two new methods which take advantage of the store's internal structures:

  1. InEdges: returns a slice of all edges in the graph with a specific target vertex
  2. OutEdges: returns a slice of all edges in the graph with a specific source vertex.

@atzoum
Copy link
Author

atzoum commented Nov 12, 2024

@dominikbraun we are facing some significant performance issues with the graph module and this change can unblock us 🙏

@atzoum atzoum force-pushed the feat.graphSrcTargetEdges branch from 0a2ca7b to cda09bd Compare November 12, 2024 15:21
@atzoum atzoum force-pushed the feat.graphSrcTargetEdges branch from cda09bd to f83abe1 Compare November 12, 2024 15:22
@dominikbraun
Copy link
Owner

Hey, so this seems to change both the Graph and Store interfaces and we'll need a new major version since it's a breaking change. I'll have a look...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants