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

Return hash map/set for vertices #56

Merged
merged 5 commits into from
Apr 15, 2024
Merged

Return hash map/set for vertices #56

merged 5 commits into from
Apr 15, 2024

Conversation

mtfishman
Copy link
Member

@mtfishman mtfishman commented Apr 14, 2024

A downside of this is that the output of vertices(g::NamedGraph) no longer has a well-defined ordering corresponding to the memory ordering of the vertices of the parent graph, and instead should be treated as, and now outputs, a set. However, an upshot is that vertex lookup is faster (O(1) instead of O(nv(g))), and user code shouldn't rely on vertex ordering anyway so I think it forces better code style.

@mtfishman mtfishman changed the title Return hash map/set for vertices [WIP] Return hash map/set for vertices Apr 14, 2024
@mtfishman mtfishman marked this pull request as draft April 14, 2024 21:43
src/distance.jl Outdated Show resolved Hide resolved
src/distance.jl Outdated Show resolved Hide resolved
@mtfishman mtfishman changed the title [WIP] Return hash map/set for vertices Return hash map/set for vertices Apr 15, 2024
@mtfishman mtfishman marked this pull request as ready for review April 15, 2024 03:40
@mtfishman mtfishman merged commit a3372a1 into main Apr 15, 2024
10 of 11 checks passed
@mtfishman mtfishman deleted the hash_vertices branch April 15, 2024 13:38
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.

1 participant