class_docstr: A cut of a given graph.
  
  This is a simple class used to represent cuts returned by
  L{Graph.mincut()}, L{Graph.all_st_cuts()} and other functions
  that calculate cuts.
  
  A cut is a special vertex clustering with only two clusters.
  Besides the usual L{VertexClustering} methods, it also has the
  following attributes:
  
    - C{value} - the value (capacity) of the cut. It is equal to
      the number of edges if there are no capacities on the
      edges.
  
    - C{partition} - vertex IDs in the parts created
      after removing edges in the cut
  
    - C{cut} - edge IDs in the cut
  
    - C{es} - an edge selector restricted to the edges
      in the cut.
  
  You can use indexing on this object to obtain lists of vertex IDs
  for both sides of the partition.
  
  This class is usually not instantiated directly, everything
  is taken care of by the functions that return cuts.
  
  Examples:
  
    >>> from igraph import Graph
    >>> g = Graph.Ring(20)
    >>> mc = g.mincut()
    >>> print(mc.value)
    2.0
    >>> print(min(len(x) for x in mc))
    1
    >>> mc.es["color"] = "red"
docstr: Initializes the cut.
  
  This should not be called directly, everything is taken care of by
  the functions that return cuts.
docstr_tok: ["Initializes","the","cut",".","This","should","not","be","called","directly",",","everything","is","taken","care","of","by","the","functions","that","return","cuts","."]
code: 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
      super().__init__(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
  
imports: from igraph._igraph import GraphBase
  from igraph.clustering import VertexClustering
label_desc: Use image node_id 1 to create a new Cut object from inherited base classes: VertexClustering with example: obj = Cut(graph, value, cut, partition, partition2)