Skip to content

Credit the chosen community and keep edge weights in the volume totals - #177

Open
arpitjain099 wants to merge 1 commit into
pnnl:masterfrom
arpitjain099:fix/modularity-volume-bookkeeping
Open

arpitjain099 wants to merge 1 commit into
pnnl:masterfrom
arpitjain099:fix/modularity-volume-bookkeeping

Conversation

@arpitjain099

Copy link
Copy Markdown

Two things in hypergraph_modularity.py.

Both _last_step variants pick a target community into best, set dct_A[v] = best, and then update VolA[m]. m is the loop variable, so the volume is credited to whichever candidate the search happened to end on. On a seeded 30 node hypergraph the returned partition changes once it is VolA[best].

VolA and Ctr are built with np.repeat(0, n), which is int64, and then accumulate HG.edges[e].weight. On a hypergraph with weights of 0.5 the volumes come out [0, 3] instead of [2.75, 5.5], because each += 0.5 truncates. np.zeros keeps them.

tests/algorithms is 41 passing.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>

This branch has not been deployed

No deployments
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