Skip to content

Commit

Permalink
fix: fix the louvain algorithm that the result is not consistent with #…
Browse files Browse the repository at this point in the history
  • Loading branch information
acezen committed Jan 8, 2024
1 parent f40ee9a commit 22c4050
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 0 additions & 7 deletions analytical_engine/apps/pregel/louvain/louvain_app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,6 @@ class LouvainAppBase
} else if (ctx.compute_context().superstep() == compress_community_step) {
ctx.GetVertexState(v).is_alived_community = false;
}

if (!ctx.compute_context().active(v)) {
std::vector<std::pair<vid_t, edata_t>> tmp_edges;
ctx.GetVertexState(v).fake_edges.swap(tmp_edges);
std::vector<vid_t> tmp_nodes;
ctx.GetVertexState(v).nodes_in_community.swap(tmp_nodes);
}
});

{
Expand Down
4 changes: 3 additions & 1 deletion python/graphscope/tests/unittest/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ def test_other_app_on_undirected_graph(

# louvain
ctx = louvain(p2p_project_undirected_graph, min_progress=50, progress_tries=2)
assert ctx is not None
df = ctx.to_dataframe({"node": "v.id", "r": "r"})
community_num = len(df["r"].unique())
assert community_num == 103
# simple_path
ctx = is_simple_path(p2p_project_undirected_graph, [1, 10])
assert ctx is not None
Expand Down

0 comments on commit 22c4050

Please sign in to comment.