Skip to content

Fix gateway coefficient module indexing - #140

Open
dnncha wants to merge 4 commits into
aestrivex:masterfrom
dnncha:fix/gateway-coefficient-indexing
Open

dnncha wants to merge 4 commits into
aestrivex:masterfrom
dnncha:fix/gateway-coefficient-indexing

Conversation

@dnncha

@dnncha dnncha commented Sep 28, 2026

Copy link
Copy Markdown

Gateway scores can mix positions inside a community with whole-network node IDs. A valid network can crash, and a larger network gets different hub rankings.

Example

In BCTPy 0.6.1, gateway_coef_sign raises IndexError on a complete six-node graph with communities [1,1,2,2,3,3]; the BCT reference returns 0.91 for each equivalent node. On the bundled 138-node fixture, the degree-weighted gateway total changes from 87.014085 to 89.614032, and the top-ten node order changes.

Fix and checks

The patch restores the module axis and uses global neighbor indices. It matches a direct translation of BCT’s 2019-03-03 algorithm on the crash case, a weighted case, and the 138-node fixture. A four-node singleton-community control agrees before and after. Three focused regressions pass.

Pinned base: c28931c; fix commit: 120acb0. Reproduction and evidence are recorded at https://github.com/dnncha/cheerfulduck/blob/main/projects/research/content/findings-20260908.json (finding bctpy-gateway-coefficient-indexing; evidence archive SHA-256 22b6b050d9f04dc96a2ae83d0bad8d4b500c6ae84cacb257188f91ee5e00f8e8).

This is a software defect and a changed result on a package fixture. I have not established an affected paper, patient decision, or scientific conclusion. No matching report was found in the upstream issues and PRs checked on 27 September 2026. Prepared with AI assistance; not independently reviewed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant