Package igraph :: Module datatypes :: Class Cut
[hide private]
[frames] | no frames]

Class Cut

object --+
         |
        Cut

A cut of a given graph.

This is a simple class used to represent cuts returned by Graph.mincut. It has the following attributes:

Attributes are not read only, but you should consider them as being read only. Unexpected behaviour may occur if you mess with them.

You can use indexing on this object to obtain VertexSeq objects of the partitions.

This class is usually not instantiated directly, everything is taken care of by Graph.mincut.

Examples:

>>> g = Graph.Ring(20)
>>> mc = g.mincut()
>>> print mc.value
2
>>> print min(map(len, mc))
1
>>> mc.es["color"] = ["red"] * len(mc.es)
Instance Methods [hide private]
 
__getitem__(self, idx)
 
__init__(self, graph, value, cut, partition, partition2)
Initializes the cut.
 
__len__(self)
 
__repr__(self)
repr(x)
 
__str__(self)
str(x)
 
_get_cut(self)
 
_get_es(self)
 
_get_graph(self)
 
_get_partition(self)
 
_get_value(self)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]
  _cut
  _graph
  _partition
  _value
  cut
Edge IDs in the cut
  es
Returns an edge selector restricted to the cut
  graph
The graph over which this cut is defined
  partition
Vertex IDs partitioned according to the cut
  value
Sum of edge capacities in the cut

Inherited from object: __class__

Method Details [hide private]

__init__(self, graph, value, cut, partition, partition2)
(Constructor)

 

Initializes the cut.

This should not be called directly, everything is taken care of by Graph.mincut.

Overrides: object.__init__

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

Property Details [hide private]

cut

Edge IDs in the cut

Get Method:
_get_cut(self)

es

Returns an edge selector restricted to the cut

Get Method:
_get_es(self)

graph

The graph over which this cut is defined

Get Method:
_get_graph(self)

partition

Vertex IDs partitioned according to the cut

Get Method:
_get_partition(self)

value

Sum of edge capacities in the cut

Get Method:
_get_value(self)