leidenalg icon indicating copy to clipboard operation
leidenalg copied to clipboard

Function find_partition() have no is_membership_fixed argument

Open CDPDisk opened this issue 3 years ago • 2 comments

I noticed that in your docs about fixed nodes it says:

This can be done using the is_membership_fixed argument of find_partition(), see 2 for some details.

And a sample program is provided. But after I viewed the code of find_partition(), I found that find_partition() does not support the argument is_membership_fixed. If I were to use it, I'd have to give up find_partition() and customize a new find_partition() myself to use this argument. Although it is easy, I'd like to add the argument to find_partition() in the future version.

CDPDisk avatar Mar 18 '22 09:03 CDPDisk

Indeed, find_partition does not support this argument now right away. For more advanced uses, you should construct an Optimiser object and call optimise_partition, for which you can use the argument is_membership_fixed, e.g. for some partition and some list fixed indicating for each node whether its membership is fixed, you can call it like

optimiser = la.Optimiser()
diff = optimiser.optimise_partition(partition, is_membership_fixed=fixed)

Your question is essentially whether is_membership_fixed can also be made available directly through find_partition?

vtraag avatar Mar 30 '22 18:03 vtraag

Yes, I hope is_membership_fixed can also be made available directly through find_partition. So fixing membership can be more easy.

CDPDisk avatar Apr 03 '22 03:04 CDPDisk