module documentation

Undocumented

Function _get_adjacency Returns the adjacency matrix of a graph.
Function _get_adjacency_sparse Returns the adjacency matrix of a graph as a SciPy CSR matrix.
Function _get_adjlist Returns the adjacency list representation of the graph.
Function _get_incidence Returns the incidence matrix of a bipartite graph. The incidence matrix is an n times m matrix, where n and m are the number of vertices in the two vertex classes.
Function _get_inclist Returns the incidence list representation of the graph.
def _get_adjacency(self, type=GET_ADJACENCY_BOTH, attribute=None, default=0, eids=False):

Returns the adjacency matrix of a graph.

Parameters
selfUndocumented
typeeither GET_ADJACENCY_LOWER (uses the lower triangle of the matrix) or GET_ADJACENCY_UPPER (uses the upper triangle) or GET_ADJACENCY_BOTH (uses both parts). Ignored for directed graphs.
attributeif None, returns the ordinary adjacency matrix. When the name of a valid edge attribute is given here, the matrix returned will contain the default value at the places where there is no edge or the value of the given attribute where there is an edge. Multiple edges are not supported, the value written in the matrix in this case will be unpredictable. This parameter is ignored if eids is True
defaultthe default value written to the cells in the case of adjacency matrices with attributes.
eidsspecifies whether the edge IDs should be returned in the adjacency matrix. Since zero is a valid edge ID, the cells in the matrix that correspond to unconnected vertex pairs will contain -1 instead of 0 if eids is True. If eids is False, the number of edges will be returned in the matrix for each vertex pair.
Returns
the adjacency matrix as a Matrix.
def _get_adjacency_sparse(self, attribute=None):

Returns the adjacency matrix of a graph as a SciPy CSR matrix.

Parameters
selfUndocumented
attributeif None, returns the ordinary adjacency matrix. When the name of a valid edge attribute is given here, the matrix returned will contain the default value at the places where there is no edge or the value of the given attribute where there is an edge.
Returns
the adjacency matrix as a scipy.sparse.csr_matrix.
def _get_adjlist(self, mode='out'):

Returns the adjacency list representation of the graph.

The adjacency list representation is a list of lists. Each item of the outer list belongs to a single vertex of the graph. The inner list contains the neighbors of the given vertex.

Parameters
selfUndocumented
modeif "out", returns the successors of the vertex. If "in", returns the predecessors of the vertex. If "all"", both the predecessors and the successors will be returned. Ignored for undirected graphs.
def _get_incidence(graph, types='type', *args, **kwds):

Returns the incidence matrix of a bipartite graph. The incidence matrix is an n times m matrix, where n and m are the number of vertices in the two vertex classes.

Parameters
graphUndocumented
typesan igraph vector containing the vertex types, or an attribute name. Anything that evalulates to False corresponds to vertices of the first kind, everything else to the second kind.
*argsUndocumented
**kwdsUndocumented
Returns
the incidence matrix and two lists in a triplet. The first list defines the mapping between row indices of the matrix and the original vertex IDs. The second list is the same for the column indices.
def _get_inclist(graph, mode='out'):

Returns the incidence list representation of the graph.

The incidence list representation is a list of lists. Each item of the outer list belongs to a single vertex of the graph. The inner list contains the IDs of the incident edges of the given vertex.

Parameters
graphUndocumented
modeif "out", returns the successors of the vertex. If "in", returns the predecessors of the vertex. If "all", both the predecessors and the successors will be returned. Ignored for undirected graphs.