leidenalg icon indicating copy to clipboard operation
leidenalg copied to clipboard

avoid random result randomness in find_partition

Open kalthwaini opened this issue 3 years ago • 2 comments

as many clustering algorithms, find_partition is giving diff results over multiple executions of same input. I'm trying to stablize this and have fixed results of same input. I have tried the seed parameter, but didn't work for me. Is there a way to reach this? (have same results for same input)

kalthwaini avatar Jul 24 '22 09:07 kalthwaini

Similar question as mine.

prakritipaul avatar Jul 28 '22 15:07 prakritipaul

Sorry for the late reply!

Could you perhaps include some code that demonstrates the problem for you?

If I run

part1 = la.find_partition(G, la.ModularityVertexPartition, seed=0)
part2 = la.find_partition(G, la.ModularityVertexPartition, seed=0)

then part1.membership == part2.membership, in other words, I get identical partition, even for random graphs G.

vtraag avatar Sep 30 '22 09:09 vtraag