Skip to content

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

Description

@INRIX-Mark-Gershaft

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions