Commit c41d1be6 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

blockmodel: fix issue with edges having zero weight

parent 93dbb6c2
......@@ -1523,9 +1523,11 @@ void build_neighbour_sampler(Vertex v, SMap& sampler, Eprop& eweight, Graph& g,
if (!self_loops && u == v)
continue;
neighbours.push_back(u);
probs.push_back(eweight[e]); // Self-loops will be added twice, and
// hence will be sampled with probability
// 2 * eweight[e]
auto w = eweight[e];
if (w == 0)
continue;
probs.push_back(w); // Self-loops will be added twice, and hence will
// be sampled with probability 2 * eweight[e]
}
sampler = Sampler<Vertex, mpl::false_>(neighbours, probs);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment