Skip to content

Add parallel percolation centrality - #161

Open
paumartin2407 wants to merge 1 commit into
networkx:mainfrom
paumartin2407:add-percolation-centrality
Open

paumartin2407 wants to merge 1 commit into
networkx:mainfrom
paumartin2407:add-percolation-centrality

Conversation

@paumartin2407

Copy link
Copy Markdown

Adds a parallel implementation of percolation_centrality.

I used the existing betweenness_centrality implementation as the main reference, since both algorithms iterate independently over source nodes and use the same shortest-path machinery. The implementation splits source nodes into chunks, computes partial percolation centrality contributions in parallel, and then reduces the partial results before applying the final normalization.

I also added the backend registration, benchmark, generated backend metadata, and timing heatmap.

Tests run:

  • NetworkX percolation centrality tests
  • get_chunks tests
  • nx-parallel test suite
  • NetworkX backend test suite
  • ASV benchmark smoke test

Contributes to #82

I used AI assistance during development to help understand the existing implementations, reason through the parallelization approach, and review the changes. I manually implemented, inspected, and tested the final code.

I’m happy to receive feedback, discuss the approach, and iterate on the implementation if needed. If the maintainers find this contribution useful, I’d also be interested in working on more of the parallelization opportunities and would be very open to some guidance or mentorship on which algorithms would be most valuable to tackle next.

@dschult @Schefflera-Arboricola

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant