@@ -548,10 +548,11 @@ def prune_to_multilayer_stable_partitions(G_intralayer, G_interlayer, layer_vec,
548
548
549
549
See https://doi.org/10.1038/s41598-022-20142-6 for more details.
550
550
551
- NOTE: This method truncates omega estimates to ``omega_end - 1e-3`` in order to properly identify stable partitions
552
- with infinite interlayer coupling estimates (e.g. when all membership labels persist across layers). If
553
- ``omega_end`` is set too low, such partitions may be incorrectly identified as stable. As such, you should be
554
- somewhat wary of the returned partitions with zero community structure differences across layers.
551
+ NOTE: This method will truncate omega estimates to ``omega_end - 1e-3`` (and raise a warning) if needed to properly
552
+ identify stable partitions with very large or infinite interlayer coupling estimates (e.g., when all membership
553
+ labels persist across layers). If ``omega_end`` is set too low, these partitions may be incorrectly identified as
554
+ stable. Conversely, some partitions with large omega estimates might be misclassified as not stable. Therefore, be
555
+ cautious of returned partitions with little or no community structure differences across layers.
555
556
556
557
:param G_intralayer: intralayer graph of interest
557
558
:type G_intralayer: igraph.Graph
@@ -611,6 +612,11 @@ def prune_to_multilayer_stable_partitions(G_intralayer, G_interlayer, layer_vec,
611
612
omega_start , omega_end )
612
613
domains_with_estimates = domains_to_gamma_omega_estimates (G_intralayer , G_interlayer , layer_vec , domains , model )
613
614
615
+ if any (o_est >= omega_end for _ , _ , g_est , o_est in domains_with_estimates if g_est is not None ):
616
+ warnings .warn (f"We are truncating some omega estimates to your choice of omega_end={ omega_end } . You should "
617
+ f"check that this accurately captures the high-omega behavior of the partition domains. "
618
+ f"Be cautious of partitions with little or no community structure differences across layers!" )
619
+
614
620
# Truncate infinite omega solutions to our maximum omega
615
621
domains_with_estimates = [(polyverts , membership , g_est , min (o_est , omega_end - 1e-3 ))
616
622
for polyverts , membership , g_est , o_est in domains_with_estimates
0 commit comments