When creating graphs from coordinates, we currently rely on distance-based neighbor selection (radius/kNN variants), but there is no direct mechanism to enforce degree constraints during edge selection itself. In practice this can produce local hubs or under-connected nodes depending on coordinate density.
I propose adding a constraint-aware neighbour selection step that enforces configurable degree bounds while preserving locality.
Proposed API
min_out_degree (default: None)
max_out_degree (default: None)
min_in_degree (default: None)
max_in_degree (default: None)
repair_strategy ("knn_fallback" / "radius_expand")
Expected behavior
- Build candidate neighbors using existing distance logic.
- Apply degree-constrained edge selection (local + deterministic).
- Run a repair pass for nodes violating minimum degree.
- Keep graph directed and preserve required edge attributes (
len, vdiff).
Why this is useful
- Prevents unstable degree extremes in irregular/sparse coordinate regions.
- Makes graph quality more controllable at construction time (not only post-hoc diagnostics).
- Helps downstream message passing behave more consistently across domains with varying point density.
Acceptance criteria
Notes
This is intentionally scoped to construction-time edge selection, not visualization or additional diagnostics.
When creating graphs from coordinates, we currently rely on distance-based neighbor selection (radius/kNN variants), but there is no direct mechanism to enforce degree constraints during edge selection itself. In practice this can produce local hubs or under-connected nodes depending on coordinate density.
I propose adding a constraint-aware neighbour selection step that enforces configurable degree bounds while preserving locality.
Proposed API
min_out_degree(default:None)max_out_degree(default:None)min_in_degree(default:None)max_in_degree(default:None)repair_strategy("knn_fallback"/"radius_expand")Expected behavior
len,vdiff).Why this is useful
Acceptance criteria
Notes
This is intentionally scoped to construction-time edge selection, not visualization or additional diagnostics.