Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_neg_weight_bipartite(self):
G = ig.Graph.Full_Bipartite(50, 50);
G.es['weight'] = -0.1;
partition = leidenalg.CPMVertexPartition(G, resolution_parameter=-0.1, weights='weight');
self.optimiser.consider_comms=leidenalg.ALL_COMMS;
self.optimiser.optimise_partition(partition);
self.assertListEqual(
partition.sizes(), 2*[50],
msg="After optimising partition failed to find bipartite structure with CPMVertexPartition(resolution_parameter=-0.1)");