python-igraph API reference

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

package documentation

IGraph library.

Package app User interfaces of igraph
Module clustering Classes related to graph clustering.
Module configuration Configuration framework for igraph.
Module cut Classes representing cuts and flows on graphs.
Module datatypes Additional auxiliary data types
Package drawing Drawing and plotting routines for IGraph.
Module formula Implementation of `igraph.Graph.Formula()`
Module layout Layout-related code in the IGraph library.
Module matching Classes representing matchings on graphs.
Module operators Implementation of union, disjoint union and intersection operators.
Package remote Classes that help igraph communicate with remote applications.
Module sparse_matrix Implementation of Python-level sparse matrix operations.
Module statistics Statistics related stuff in igraph
Module summary Summary representation of a graph.
Module utils Utility functions that cannot be categorised anywhere else.
Module version Undocumented
Module _igraph Low-level Python interface for the igraph library. Should not be used directly.

From __init__.py:

Class EdgeSeq Class representing a sequence of edges in the graph.
Class Graph Generic graph.
Class VertexSeq Class representing a sequence of vertices in the graph.
Function autocurve Calculates curvature values for each of the edges in the graph to make sure that multiple edges are shown properly on a graph plot.
Function deprecated Prints a warning message related to the deprecation of some igraph feature.
Function get_include Returns the folder that contains the C API headers of the Python interface of igraph.
Function read Loads a graph from the given filename.
Function write Saves a graph to the given file.
Variable __license__ Undocumented
Variable config Undocumented
Function _3d_version_for Creates an alias for the 3D version of the given layout algoritm.
Function _add_proxy_methods Undocumented
Function _graphmethod Auxiliary decorator
Function _layout_method_wrapper Wraps an existing layout method to ensure that it returns a Layout instead of a list of lists.
__license__: str =

Undocumented

def deprecated(message):

Prints a warning message related to the deprecation of some igraph feature.

def _graphmethod(func=None, name=None):

Auxiliary decorator

This decorator allows some methods of VertexSeq and EdgeSeq to call their respective counterparts in Graph to avoid code duplication.

Parameters
functhe function being decorated. This function will be called on the results of the original Graph method. If None, defaults to the identity function.
namethe name of the corresponding method in Graph. If None, it defaults to the name of the decorated function.
Returns
the decorated function
def _add_proxy_methods():

Undocumented

def _layout_method_wrapper(func):

Wraps an existing layout method to ensure that it returns a Layout instead of a list of lists.

Parameters
functhe method to wrap. Must be a method of the Graph object.
Returns
a new method
def _3d_version_for(func):

Creates an alias for the 3D version of the given layout algoritm.

This function is a decorator that creates a method which calls func after attaching dim=3 to the list of keyword arguments.

Parameters
funcmust be a method of the Graph object.
Returns
a new method
def autocurve(graph, attribute='curved', default=0):

Calculates curvature values for each of the edges in the graph to make sure that multiple edges are shown properly on a graph plot.

This function checks the multiplicity of each edge in the graph and assigns curvature values (numbers between -1 and 1, corresponding to CCW (-1), straight (0) and CW (1) curved edges) to them. The assigned values are either stored in an edge attribute or returned as a list, depending on the value of the attribute argument.

Parameters
graphthe graph on which the calculation will be run
attributethe name of the edge attribute to save the curvature values to. The default value is curved, which is the name of the edge attribute the default graph plotter checks to decide whether an edge should be curved on the plot or not. If attribute is None, the result will not be stored.
defaultthe default curvature for single edges. Zero means that single edges will be straight. If you want single edges to be curved as well, try passing 0.5 or -0.5 here.
Returns
the list of curvature values if attribute is None, otherwise None.
def get_include():

Returns the folder that contains the C API headers of the Python interface of igraph.

def read(filename, *args, **kwds):

Loads a graph from the given filename.

This is just a convenience function, calls Graph.Read directly. All arguments are passed unchanged to Graph.Read

Parameters
filenamethe name of the file to be loaded
*argsUndocumented
**kwdsUndocumented
def write(graph, filename, *args, **kwds):

Saves a graph to the given file.

This is just a convenience function, calls Graph.write directly. All arguments are passed unchanged to Graph.write

Parameters
graphthe graph to be saved
filenamethe name of the file to be written
*argsUndocumented
**kwdsUndocumented
config =

Undocumented