From 2d315d45824dfe237a38de864139e0bfb9fed58d Mon Sep 17 00:00:00 2001 From: Tiago de Paula Peixoto Date: Sun, 3 Nov 2013 11:11:21 +0100 Subject: [PATCH] Forbid creation of empty blocks in mcmc_sweep() --- src/graph/community/graph_blockmodel.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/graph/community/graph_blockmodel.hh b/src/graph/community/graph_blockmodel.hh index d86a6eb3..c2d99e0d 100644 --- a/src/graph/community/graph_blockmodel.hh +++ b/src/graph/community/graph_blockmodel.hh @@ -1197,6 +1197,10 @@ void move_sweep(EMprop mrs, Vprop mrp, Vprop mrm, Vprop wr, Vprop b, vertex_t v = vertex(vlist[i], g); vertex_t r = b[v]; + // blocks can't become empty + if (wr[r] == 1) + continue; + if (!sequential) moves[i] = r; -- GitLab