# Stochastic Block Model algorithm

**URL:** <https://igraph.discourse.group/t/stochastic-block-model-algorithm/115>\
**Category:** Development\
**Created:** [26 February 2020 21:26 UTC](https://igraph.discourse.group/t/stochastic-block-model-algorithm/115 "2020-02-26T21:26:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vtraag](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/vtraag/32/38_2.png) [@vtraag](https://igraph.discourse.group/u/vtraag)\
**Post date:** [26 February 2020 21:26 UTC](https://igraph.discourse.group/t/stochastic-block-model-algorithm/115/1 "2020-02-26T21:26:09Z")

</div>

It would be nice if there would be an SBM clustering algorithm implemented in `igraph`. We currently only have SBM sampling functions (`igraph_sbm_game` and the like).

@tamas, it seems you once developed an implementation of an [SBM algorithm](https://github.com/ntamas/blockmodel). Is there any chance that it could be included in `igraph` at one point?

There is of course the implementation of [SBM](https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#the-stochastic-block-model-sbm) in `graph-tool` by Tiago Peixoto, but I imagine it will be quite some work to translate that implementation to `igraph`. I don’t know of any other implementations that could be easily integrated into `igraph`?

---

<div class="post-metadata">

**Author:** ![tamas](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/tamas/32/1261_2.png) [@tamas](https://igraph.discourse.group/u/tamas)\
**Post date:** [27 February 2020 11:24 UTC](https://igraph.discourse.group/t/stochastic-block-model-algorithm/115/2 "2020-02-27T11:24:24Z")

</div>

> [@vtraag](#):
>
> Is there any chance that it could be included in `igraph` at one point?

There is; it is basically a matter of priorities only. I’m quite swamped with other things at the moment, but we can try to fit this into the development roadmap for 0.9 or 1.0, depending on how badly you guys need it 🙂

---

<div class="post-metadata">

**Author:** ![vtraag](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/vtraag/32/38_2.png) [@vtraag](https://igraph.discourse.group/u/vtraag)\
**Post date:** [27 February 2020 12:07 UTC](https://igraph.discourse.group/t/stochastic-block-model-algorithm/115/3 "2020-02-27T12:07:33Z")

</div>

OK, sounds good! I don’t think it is a high priority, 0.9 or 1.0 should be fine. But good to know that it sounds feasible.
