python-igraph API reference

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

class documentation

class GraphSummary:

View In Hierarchy

Summary representation of a graph.

The summary representation includes a header line and the list of edges. The header line consists of IGRAPH, followed by a four-character long code, the number of vertices, the number of edges, two dashes (--) and the name of the graph (i.e. the contents of the name attribute, if any). For instance, a header line may look like this:

    IGRAPH U--- 4 5 --

The four-character code describes some basic properties of the graph. The first character is U if the graph is undirected, D if it is directed. The second letter is N if the graph has a vertex attribute called name, or a dash otherwise. The third letter is W if the graph is weighted (i.e. it has an edge attribute called weight), or a dash otherwise. The fourth letter is B if the graph has a vertex attribute called type; this is usually used for bipartite graphs.

Edges may be presented as an ordinary edge list or an adjacency list. By default, this depends on the number of edges; however, you can control it with the appropriate constructor arguments.

Method __init__ Constructs a summary representation of a graph.
Method __str__ Returns the summary representation as a string.
Instance Variable edge_list_format Undocumented
Instance Variable max_rows Undocumented
Instance Variable print_edge_attributes Undocumented
Instance Variable print_graph_attributes Undocumented
Instance Variable print_vertex_attributes Undocumented
Instance Variable verbosity Undocumented
Instance Variable width Undocumented
Instance Variable wrapper Undocumented
Method _construct_edgelist_adjlist Constructs the part in the summary that prints the edge list in an adjacency list format.
Method _construct_edgelist_compressed Constructs the part in the summary that prints the edge list in a compressed format suitable for graphs with mostly small degrees.
Method _construct_edgelist_edgelist Constructs the part in the summary that prints the edge list in a full edge list format.
Method _construct_graph_attributes Constructs the part in the summary that lists the graph attributes.
Method _construct_header Constructs the header part of the summary.
Method _construct_vertex_attributes Constructs the part in the summary that lists the vertex attributes.
Method _edge_attribute_iterator Returns an iterator that yields the rows of the edge attribute table in the summary. attribute_order must be a list containing the names of the attributes to be presented in this table.
Method _infer_column_alignment Infers the preferred alignment for the given vertex and edge attributes in the tables by peeking into the attribute values of the first 100 vertices or edges. Numeric attributes will be aligned right, everything else will be aligned left.
Method _new_table Constructs a new table to pretty-print vertex and edge attributes
Method _vertex_attribute_iterator Returns an iterator that yields the rows of the vertex attribute table in the summary. attribute_order must be a list containing the names of the attributes to be presented in this table.
Instance Variable _arrow Undocumented
Instance Variable _arrow_format Undocumented
Instance Variable _edges_header Undocumented
Instance Variable _graph Undocumented
def __init__(self, graph, verbosity=0, width=78, edge_list_format='auto', max_rows=99999, print_graph_attributes=False, print_vertex_attributes=False, print_edge_attributes=False, full=False):

Constructs a summary representation of a graph.

Parameters
graphUndocumented
verbositythe verbosity of the summary. If zero, only the header line will be returned. If one, the header line and the list of edges will both be returned.
widththe maximal width of each line in the summary. None means that no limit will be enforced.
edge_list_formatformat of the edge list in the summary. Supported formats are: compressed, adjlist, edgelist, auto, which selects automatically from the other three based on some simple criteria.
max_rowsthe maximal number of rows to print in a single table (e.g., vertex attribute table or edge attribute table)
print_graph_attributeswhether to print graph attributes if there are any.
print_vertex_attributeswhether to print vertex attributes if there are any.
print_edge_attributeswhether to print edge attributes if there are any.
fullFalse has no effect; True turns on the attribute printing for graph, vertex and edge attributes with verbosity 1.
def __str__(self):

Returns the summary representation as a string.

edge_list_format =

Undocumented

max_rows =

Undocumented

print_edge_attributes =

Undocumented

print_graph_attributes =

Undocumented

print_vertex_attributes =

Undocumented

verbosity =

Undocumented

width =

Undocumented

wrapper =

Undocumented

def _construct_edgelist_adjlist(self):

Constructs the part in the summary that prints the edge list in an adjacency list format.

def _construct_edgelist_compressed(self):

Constructs the part in the summary that prints the edge list in a compressed format suitable for graphs with mostly small degrees.

def _construct_edgelist_edgelist(self):

Constructs the part in the summary that prints the edge list in a full edge list format.

def _construct_graph_attributes(self):

Constructs the part in the summary that lists the graph attributes.

def _construct_header(self):

Constructs the header part of the summary.

def _construct_vertex_attributes(self):

Constructs the part in the summary that lists the vertex attributes.

def _edge_attribute_iterator(self, attribute_order):

Returns an iterator that yields the rows of the edge attribute table in the summary. attribute_order must be a list containing the names of the attributes to be presented in this table.

def _infer_column_alignment(self, vertex_attrs=None, edge_attrs=None):

Infers the preferred alignment for the given vertex and edge attributes in the tables by peeking into the attribute values of the first 100 vertices or edges. Numeric attributes will be aligned right, everything else will be aligned left.

def _new_table(self, headers=None):

Constructs a new table to pretty-print vertex and edge attributes

def _vertex_attribute_iterator(self, attribute_order):

Returns an iterator that yields the rows of the vertex attribute table in the summary. attribute_order must be a list containing the names of the attributes to be presented in this table.

_arrow =

Undocumented

_arrow_format =

Undocumented

_edges_header: str =

Undocumented

_graph =

Undocumented