Fix grid edge counting, implicit vertex count and handle edge cases#89
Merged
DanielSeemaier merged 4 commits intoKarlsruheGraphGeneration:mainfrom Jan 21, 2026
Conversation
1489464
into
KarlsruheGraphGeneration:main
4 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dear KaGen Team,
When we wanted to benchmark the streaming generator for grid graphs, we encountered a problem if we want to generate all possible edges of a grid.
In particular, running
./build/examples/example_node_streaming "grid2d;x=4;y=4;m=24" 2 16results in the following behavior:
This reveals two problems:
This PR addresses the above issues and some related edge cases:
nis not, we set the number of vertices to the value implied by the grid dimensions.p=0, since in these cases the maximum number of edges is necessarily zero and this is not feasible in this case (becausem=0was also not allowed before).periodic = 1, we have to look at the special case if one dimension is less or equal 2, since wrap-around edges might lead to parallel edges.ConfigurationErrorwhenmexceeds the maximum number of edges. If a different behavior is preferred here, please let me know.I hope these changes resolve the mentioned problems. Please feel free to suggest adjustments or alternative behavior if desired.