python-igraph API reference

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

package documentation

IGraph library.
Package app User interfaces of igraph
Package drawing Drawing and plotting routines for IGraph.
Package io Undocumented
Package operators Implementation of union, disjoint union and intersection operators.
Package remote Classes that help igraph communicate with remote applications.
Module adjacency No module docstring; 5/5 functions documented
Module automorphisms No module docstring; 2/2 functions documented
Module basic No module docstring; 8/8 functions documented
Module bipartite No module docstring; 3/3 functions documented
Module clustering Classes related to graph clustering.
Module community No module docstring; 13/13 functions documented
Module configuration Configuration framework for igraph.
Module cut Classes representing cuts and flows on graphs.
Module datatypes Additional auxiliary data types
Module formula Implementation of igraph.Graph.Formula().
Module layout Layout-related code in the IGraph library.
Module matching Classes representing matchings on graphs.
Module seq No module docstring; 1/2 function documented
Module sparse​_matrix Implementation of Python-level sparse matrix operations.
Module statistics Statistics related stuff in igraph
Module structural No module docstring; 4/4 functions documented
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 ​ARPACKOptions Class representing the parameters of the ARPACK module.
Class ​BFSIter igraph BFS iterator object
Class ​Cut A cut of a given graph.
Class ​DFSIter igraph DFS iterator object
Class ​Edge Class representing a single edge in a graph.
Class ​Edge​Seq Class representing a sequence of edges in the graph.
Class ​Graph Generic graph.
Class ​Graph​Base Low-level representation of a graph.
Class ​Internal​Error Undocumented
Class ​Matching A matching of vertices in a graph.
Class ​Vertex Class representing a single vertex in a graph.
Class ​Vertex​Seq Class representing a sequence of vertices in the graph.
Function community​_to​_membership Undocumented
Function convex​_hull Calculates the convex hull of a given point set.
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 is​_degree​_sequence Deprecated since 0.9 in favour of is_graphical().
Function is​_graphical​_degree​_sequence Deprecated since 0.9 in favour of is_graphical().
Function read Loads a graph from the given filename.
Function set​_progress​_handler No summary
Function set​_random​_number​_generator No summary
Function set​_status​_handler Sets the handler to be called when igraph tries to display a status message.
Function write Saves a graph to the given file.
Variable __license__ Undocumented
Variable config The main configuration object of igraph. Use this object to modify igraph's behaviour, typically when used in interactive mode.
__license__: str =

Undocumented

def community_to_membership(merges, nodes, steps, return_csize=False):

Undocumented

def convex_hull(vs, coords=False):
Calculates the convex hull of a given point set.
Parameters
vsthe point set as a list of lists
coordsif True, the function returns the coordinates of the corners of the convex hull polygon, otherwise returns the corner indices.
Returns
either the hull's corner coordinates or the point indices corresponding to them, depending on the coords parameter.
def is_degree_sequence(out_deg, in_deg=None):

Deprecated since 0.9 in favour of is_graphical().

Returns whether a list of degrees can be a degree sequence of some graph.

Note that it is not required for the graph to be simple; in other words, this function may return True for degree sequences that can be realized using one or more multiple or loop edges only.

In particular, this function checks whether

  • all the degrees are non-negative
  • for undirected graphs, the sum of degrees are even
  • for directed graphs, the two degree sequences are of the same length and equal sums
Parameters
out​_degthe list of degrees. For directed graphs, this list must contain the out-degrees of the vertices.
in​_degthe list of in-degrees for directed graphs. This parameter must be None for undirected graphs.
Returns
True if there exists some graph that can realize the given degree sequence, False otherwise.
def is_graphical_degree_sequence(out_deg, in_deg=None):

Deprecated since 0.9 in favour of is_graphical().

Returns whether a list of degrees can be a degree sequence of some simple graph.

Note that it is required for the graph to be simple; in other words, this function will return False for degree sequences that cannot be realized without using one or more multiple or loop edges.

Parameters
out​_degthe list of degrees. For directed graphs, this list must contain the out-degrees of the vertices.
in​_degthe list of in-degrees for directed graphs. This parameter must be None for undirected graphs.
Returns
True if there exists some simple graph that can realize the given degree sequence, False otherwise.
def set_progress_handler(handler):
Sets the handler to be called when igraph is performing a long operation.
Parameters
handlerthe progress handler function. It must accept two arguments, the first is the message informing the user about what igraph is doing right now, the second is the actual progress information (a percentage).
def set_random_number_generator(generator):
Sets the random number generator used by igraph.
Parameters
generatorthe generator to be used. It must be a Python object with at least three attributes: random, randint and gauss. Each of them must be callable and their signature and behaviour must be identical to random.random, random.randint and random.gauss. By default, igraph uses the random module for random number generation, but you can supply your alternative implementation here. If the given generator is None, igraph reverts to the default Mersenne twister generator implemented in the C layer, which might be slightly faster than calling back to Python for random numbers, but you cannot set its seed or save its state.
def set_status_handler(handler):

Sets the handler to be called when igraph tries to display a status message.

This is used to communicate the progress of some calculations where no reasonable progress percentage can be given (so it is not possible to use the progress handler).

Parameters
handlerthe status handler function. It must accept a single argument, the message that informs the user about what igraph is doing right now.
def deprecated(message):
Prints a warning message related to the deprecation of some igraph feature.
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 =
The main configuration object of igraph. Use this object to modify igraph's behaviour, typically when used in interactive mode.