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

Update graph.ex docs regarding duplicate vertex id issue #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/graph.ex
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ defmodule Graph do

- `type: :directed | :undirected`, specifies what type of graph this is. Defaults to a `:directed` graph.
- `vertex_identifier`: a function which accepts a vertex and returns a unique identifier of said vertex.
Defaults to `Graph.Utils.vertex_id/1`, a hash of the whole vertex utilizing `:erlang.phash2/2`.
Defaults to `Graph.Utils.vertex_id/1`, a hash of the whole vertex utilizing `:erlang.phash2/2`. For graphs
with large numbers of vertices (more than ~10_000) collisions become more likely with `:erlang.phash2/2`
which can lead to some vertices not being added as expected due to duplicate vertex id's. Consider using
a different hash function in those cases.

## Example

Expand Down
Loading