Skip to content

Add Graph#getEdgeIteratorStateForKey(edgeKey) and edgeState.getEdgeKey() - #2150

Merged
easbar merged 10 commits into
masterfrom
edge_by_key
Oct 7, 2020
Merged

easbar merged 10 commits into
masterfrom
edge_by_key

Conversation

@easbar

@easbar easbar commented Oct 5, 2020

Copy link
Copy Markdown
Member

This PR adds two new methods:

  • EdgeIteratorState#getEdgeKey() can be used to get an edge key from an edge state. The edge key is a combination of the edge ID and the direction of the edge, so its a unique identifier of a (directed) edge. It is equal to 2*edgeId if the edge state matches the direction in which the edge is stored in BaseGraph and equal to 2*edgeId+1 otherwise.

  • `Graph#getEdgeIteratorStateForKey(edgeKey) can be used to retrieve an edge state given an edge key.

Compared to #2146 this PR does not try to get rid of GHUtility#createEdgeKey(int, int, int, boolean) yet, but this should be at least easier to do after this PR.

@easbar easbar added this to the 3.0 milestone Oct 5, 2020
@easbar
easbar requested a review from michaz October 5, 2020 17:57
@easbar
easbar merged commit 1f54199 into master Oct 7, 2020
@easbar
easbar deleted the edge_by_key branch October 7, 2020 09:02
This was referenced Oct 7, 2020
@easbar easbar mentioned this pull request Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants