Skip to content

Native graph engine: degree assortativity without numpy #3036

Closed

Description

@squid-protocol

Part of #3033.

Scope

Single-pass Pearson over per-edge (out-degree of source, in-degree of target), matching degree_assortativity_coefficient(G, "out", "in"), including its NaN→0.0 handling in the sensor.

Also fixes the silent None when networkx is present but numpy is not.

Acceptance criteria

  • Equal to networkx on the parity harness
  • Replaces the nx call to nx.degree_assortativity_coefficient(G)
  • Fixes the silent None when networkx is present but numpy is not

Relevant baseline

operation networkx notes
assortativity 16.6 ms numpy-backed

Networkx conventions to match

  • degree_assortativity_coefficient(G, x="out", y="in", weight=None): built from degree_mixing_matrix, then _numeric_ac
  • A native version must reproduce the Pearson correlation over (out-degree of source, in-degree of target) per edge
  • Floating-point order must be close enough to round-equal at the stored 4 dp

Activity

  1. added
    enhancement
    metrics
    core-engine
    on Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-engineenhancementmetrics

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions