Leiden algorithm: add iteration scheme to C core
@vtraag I noticed that both the Python and R bindings you contributed support iterating the algorithm multiple times, potentially until nothing changes.
So far, the philosophy that igraph followed was to implement as much as possible in the C core. It would be useful to include the iteration scheme in the C core as well, even if that seems trivial. It would both reduce the burden for the implementors of high-level interfaces, and provide some guidance on how to use the Leiden function.
Indeed, this would be a nice addition to the C core.
I indeed considered that too trivial to implement in the C core. But if you feel it is better implemented in the C core, that would be fine as well. I will then also implement the use of modularity immediately, that is now also left to the higher-level interface.
It would also ensure some consistency between different high-level interfaces.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
I'd love to see this implemented.
It'd be really great to have this in 0.10 if you have time @vtraag. I'll add it to that milestone so it doesn't get forgotten, but if we don't have time, we'll just skip it.
Ping on this. I don't want to re-implement this for the Mma interface, so I'd love to see this implemented in the C core. Targeting to 0.10.x.
I'll try to get this implemented before 0.10. I was just thinking to extend the main function as
igraph_error_t igraph_community_leiden(const igraph_t *graph,
const igraph_vector_t *edge_weights, const igraph_vector_t *node_weights,
const igraph_real_t resolution_parameter, const igraph_real_t beta, const igraph_bool_t start,
+ const igraph_integer_t iterations,
igraph_vector_int_t *membership, igraph_integer_t *nb_clusters, igraph_real_t *quality) {
Is this what you had in mind @szhorvat ? Or would you expect something else here still?
Yes, that sounds good to me.