List of all classes, functions and methods in python-igraph
The cover of the vertex set of a graph.
This class extends Cover
by linking it to a specific Graph
object. It also provides some handy methods like getting the subgraph corresponding to a cluster and such.
Note | since this class is linked to a Graph , destroying the graph by the del operator does not free the memory occupied by the graph if there exists a VertexCover that references the Graph . |
Method | __init__ |
Creates a cover object for a given graph. |
Method | crossing |
Returns a boolean vector where element i is True iff edge i lies between clusters, False otherwise. |
Property | graph |
Returns the graph belonging to this object |
Method | subgraph |
Get the subgraph belonging to a given cluster. |
Method | subgraphs |
Gets all the subgraphs belonging to each of the clusters. |
Method | __plot__ |
Plots the cover to the given Cairo context in the given bounding box. |
Instance Variable | _graph |
Undocumented |
Method | _formatted_cluster_iterator |
Iterates over the clusters and formats them into a string to be presented in the summary. |
Inherited from Cover
:
Method | __getitem__ |
Returns the cluster with the given index. |
Method | __iter__ |
Iterates over the clusters in this cover. |
Method | __len__ |
Returns the number of clusters in this cover. |
Method | __str__ |
Returns a string representation of the cover. |
Property | membership |
Returns the membership vector of this cover. |
Property | n |
Returns the number of elements in the set covered by this cover. |
Method | size |
Returns the size of a given cluster. |
Method | sizes |
Returns the size of given clusters. |
Method | size_histogram |
Returns the histogram of cluster sizes. |
Method | summary |
Returns the summary of the cover. |
Instance Variable | _clusters |
Undocumented |
Instance Variable | _n |
Undocumented |
igraph.clustering.Cover.__init__
igraph.clustering.CohesiveBlocks
Creates a cover object for a given graph.
Parameters | graph | the graph that will be associated to the cover |
clusters | the list of clusters. If None , it is assumed that there is only a single cluster that covers the whole graph. |
Returns a boolean vector where element i is True
iff edge i lies between clusters, False
otherwise.
Get the subgraph belonging to a given cluster.
Precondition: the vertex set of the graph hasn't been modified since the moment the cover was constructed.
Parameters | idx | the cluster index |
Returns | a copy of the subgraph |
Gets all the subgraphs belonging to each of the clusters.
Precondition: the vertex set of the graph hasn't been modified since the moment the cover was constructed.
Returns | a list containing copies of the subgraphs |
igraph.clustering.CohesiveBlocks
Plots the cover to the given Cairo context in the given bounding box.
This is done by calling Graph.__plot__()
with the same arguments, but drawing nice colored blobs around the vertex groups.
This method understands all the positional and keyword arguments that are understood by Graph.__plot__()
, only the differences will be highlighted here:
mark_groups
: whether to highlight the vertex clusters by colored polygons. Besides the values accepted by Graph.__plot__
(i.e., a dict mapping colors to vertex indices, a list containing lists of vertex indices, or False
), the following are also accepted:True
: all the clusters will be highlighted, the colors matching the corresponding color indices from the current palette (see the palette
keyword argument of Graph.__plot__
.The value of the plotting.mark_groups
configuration key is also taken into account here; if that configuration key is True
and mark_groups
is not given explicitly, it will automatically be set to True
.
In place of lists of vertex indices, you may also use VertexSeq
instances.
In place of color names, you may also use color indices into the current palette. None
as a color name will mean that the corresponding group is ignored.
palette
: the palette used to resolve numeric color indices to RGBA values. By default, this is an instance of ClusterColoringPalette
.See Also | Graph.__plot__() for more supported keyword arguments. |