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

[BUG] Documentation doesn't clearly state how edgeCapacity parameter of BidirectionalGraph is used #79

Open
INRIX-Mark-Gershaft opened this issue Sep 7, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@INRIX-Mark-Gershaft
Copy link

Describe the bug
Documentation about edgeCapacity is leading into belief that it is equivalent to vertexCapacity while it actually results in allocation of "edgeCapacity" entries for each vertex.

To Reproduce
Steps to reproduce the behavior:

var graph = new BidirectionalGraph<SegmentVertex, SegmentEdge<TSegment>>(allowParallelEdges: true, vertexCapacity: segments.Length, edgeCapacity: segments.Length);
. . .
graph.AddVertexRange(vertices); // <<<< OOM because it allocates 2 * segments.Length * segment.Length objects
// 2x because it allocates in and out collections 
// segment.Length * segment.Length because for each vertex it allocates edgeCapacity expected edges.

Expected behavior
A clear and concise description of what edgeCapacity is for - expected valency of vertices.

@INRIX-Mark-Gershaft INRIX-Mark-Gershaft added the bug Something isn't working label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants