bitwalker / bitwalker/libgraph

Duplicate vertex ids when adding high number of vertices

Open
#44 12 comments 9 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
571
Forks
76
PR merge metrics
No merged PRs in 30d

Description

When adding large number of vertices, some of my vertices weren't added to the graph.

For example
```
vertices = 0..250000 |> Enum.map(& &1)
Graph.add_vertices(Graph.new, vertices)
#Graph
```

I fixed it for myself by changing the function `Graph.Utils.vertex_id(v)` to
``` def vertex_id(v), do: v```
instead of
``` def vertex_id(v), do: :erlang.phash2(v, @max_phash)```

Apparently I had duplicate key in my graph otherwise.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.