python-igraph API reference

List of all classes, functions and methods in python-igraph

class documentation

class Cut(VertexClustering):

Known subclasses: igraph.cut.Flow

View In Hierarchy

A cut of a given graph.

This is a simple class used to represent cuts returned by Graph.mincut(), Graph.all_st_cuts() and other functions that calculate cuts.

A cut is a special vertex clustering with only two clusters. Besides the usual VertexClustering methods, it also has the following attributes:

  • value - the value (capacity) of the cut. It is equal to the number of edges if there are no capacities on the edges.
  • partition - vertex IDs in the parts created after removing edges in the cut
  • cut - edge IDs in the cut
  • 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"
Method __init__ Initializes the cut.
Method __repr__ Undocumented
Method __str__ Undocumented
Property es Returns an edge selector restricted to the cut
Property partition Returns the vertex IDs partitioned according to the cut
Property cut Returns the edge IDs in the cut
Property value Returns the sum of edge capacities in the cut
Instance Variable _value Undocumented
Instance Variable _partition Undocumented
Instance Variable _cut Undocumented
def __init__(self, graph, value=None, cut=None, partition=None, partition2=None):
overridden in igraph.cut.Flow

Initializes the cut.

This should not be called directly, everything is taken care of by the functions that return cuts.

_value =

Undocumented

_partition =

Undocumented

_cut =

Undocumented

def __repr__(self):
overridden in igraph.cut.Flow

Undocumented

def __str__(self):
overridden in igraph.cut.Flow

Undocumented

@property
es =

Returns an edge selector restricted to the cut

@property
partition =

Returns the vertex IDs partitioned according to the cut

@property
cut =

Returns the edge IDs in the cut

@property
value =

Returns the sum of edge capacities in the cut

API Documentation for igraph, generated by pydoctor 21.2.2.