Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix: compute DirectedGraph inCloseness with mode = "in" - #364

Merged
bburns632 merged 1 commit into
uptake:mainfrom
chenyangsu:fix/directed-graph-incloseness-mode
Nov 29, 2026
Merged

bburns632 merged 1 commit into
uptake:mainfrom
chenyangsu:fix/directed-graph-incloseness-mode

Conversation

@chenyangsu

Copy link
Copy Markdown
Contributor

On a directed chain a -> b -> c, DirectedGraph$node_measures(c("outCloseness", "inCloseness")) returns c(0.667, 1, NaN) for both columns instead of c(NaN, 1, 0.667) for inCloseness, because inCloseness calls igraph::closeness() with mode = "out" rather than mode = "in" (per igraph::closeness() and DirectedGraphMeasures). graphInCloseness is affected as well since it centralizes inCloseness.

Switch inCloseness to mode = "in" and add a regression test for inCloseness and graphInCloseness. Happy to also update the graphInCloseness description in DirectedGraphMeasures in the same PR if you prefer.

Testing: NOT_CRAN=true testthat::test_local() -> 288 passed, 0 failed, 0 warnings, 0 skipped.

@bburns632

Copy link
Copy Markdown
Collaborator

@chenyangsu thank you for catching this typo!

@bburns632
bburns632 merged commit 6b7b502 into uptake:main Nov 29, 2026
3 of 4 checks passed
@bburns632 bburns632 mentioned this pull request Nov 29, 2026
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.

2 participants