class GraphSummary:
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 |
Undocumented |
Instance Variable | max |
Undocumented |
Instance Variable | print |
Undocumented |
Instance Variable | print |
Undocumented |
Instance Variable | print |
Undocumented |
Instance Variable | verbosity |
Undocumented |
Instance Variable | width |
Undocumented |
Instance Variable | wrapper |
Undocumented |
Method | _construct |
Constructs the part in the summary that prints the edge list in an adjacency list format. |
Method | _construct |
Constructs the part in the summary that prints the edge list in a compressed format suitable for graphs with mostly small degrees. |
Method | _construct |
Constructs the part in the summary that prints the edge list in a full edge list format. |
Method | _construct |
Constructs the part in the summary that lists the graph attributes. |
Method | _construct |
Constructs the header part of the summary. |
Method | _construct |
Constructs the part in the summary that lists the vertex attributes. |
Method | _edge |
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 |
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 |
Constructs a new table to pretty-print vertex and edge attributes |
Method | _vertex |
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 |
Undocumented |
Instance Variable | _edges |
Undocumented |
Instance Variable | _graph |
Undocumented |
Constructs a summary representation of a graph.
Parameters | |
graph | Undocumented |
verbosity | the 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. |
width | the maximal width of each line in the summary. None means that no limit will be enforced. |
edge | format 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 | the maximal number of rows to print in a single table (e.g., vertex attribute table or edge attribute table) |
print | whether to print graph attributes if there are any. |
print | whether to print vertex attributes if there are any. |
print | whether to print edge attributes if there are any. |
full | False has no effect; True turns on the attribute printing for graph, vertex and edge attributes with verbosity 1. |
Constructs the part in the summary that prints the edge list in a compressed format suitable for graphs with mostly small degrees.
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.
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.