It might actually make sense to rename membership to fixed_membership. Additionally, a sort of relabelling object might be more appropriate than the map, also in terms of speed. This would essentially consist of two vectors,
where fixed_nodes contains the nodes that are fixed, and fixed_memberships is of length the number of nodes in the graph (n), and contains for each node the fixed membership (which is only meaningful for a node in fixed_nodes. Possibly, an additional boolean vector is_node_fixed could be used to determine quickly whether a node is fixed or not, but I don't immediately know whether that is necessary or not.
Or we could work with these two vectors directly.
In addition, we should probably rename fixed_nodes in Optimiser to is_node_fixed for clarity.
It might actually make sense to rename
membership
tofixed_membership
. Additionally, a sort of relabelling object might be more appropriate than themap
, also in terms of speed. This would essentially consist of twovector
s,where
fixed_nodes
contains the nodes that are fixed, andfixed_memberships
is of length the number of nodes in the graph (n
), and contains for each node the fixed membership (which is only meaningful for a node infixed_nodes
. Possibly, an additional boolean vectoris_node_fixed
could be used to determine quickly whether a node is fixed or not, but I don't immediately know whether that is necessary or not.Or we could work with these two vectors directly.
In addition, we should probably rename
fixed_nodes
inOptimiser
tois_node_fixed
for clarity.Originally posted by @vtraag in https://github.com/vtraag/leidenalg/pull/40