(self, graph, value=None, cut=None, partition=None, partition2=None)
Initializes the cut.

        This should not be called directly, everything is taken care of by
        the functions that return cuts.
Initializes the cut.
Initializes the cut .
def __init__(self, graph, value=None, cut=None, partition=None, partition2=None):
        """Initializes the cut.

        This should not be called directly, everything is taken care of by
        the functions that return cuts.
        """
        # Input validation
        if partition is None or cut is None:
            raise ValueError("partition and cut must be given")

        # Set up a membership vector, initialize parent class
        membership = [1] * graph.vcount()
        for vid in partition:
            membership[vid] = 0
        VertexClustering.__init__(self, graph, membership)

        if value is None:
            # Value of the cut not given, count the number of edges
            value = len(cut)
        self._value = float(value)

        self._partition = sorted(partition)
        self._cut = cut
def __init__ ( self , graph , value = None , cut = None , partition = None , partition2 = None ) : # Input validation if partition is None or cut is None : raise ValueError ( "partition and cut must be given" ) # Set up a membership vector, initialize parent class membership = [ 1 ] * graph . vcount ( ) for vid in partition : membership [ vid ] = 0 VertexClustering . __init__ ( self , graph , membership ) if value is None : # Value of the cut not given, count the number of edges value = len ( cut ) self . _value = float ( value ) self . _partition = sorted ( partition ) self . _cut = cut