How to use the leidenalg.CPMVertexPartition.Bipartite function in leidenalg

To help you get started, we’ve selected a few leidenalg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vtraag / leidenalg / tests / test_VertexPartition.py View on Github external
def test_Bipartite(self):
    graph = bipartite_graph
    partition, partition_0, partition_1 = \
        leidenalg.CPMVertexPartition.Bipartite(graph, resolution_parameter_01=0.2)
    self.optimiser.optimise_partition_multiplex([partition, partition_0, partition_1],
                                     layer_weights=[1, -1, -1])
    self.assertEqual(len(partition), 1)