class documentation

图的摘要表示。

摘要表示包括标题行和边的列表。标题行由IGRAPH开头,后跟一个四字符长的代码、顶点数量、边数量、两个破折号(--)和图表的名称(即name属性的内容,如果有的话)。例如,标题行可能看起来像这样:

    IGRAPH U--- 4 5 --

四字符代码描述了图的一些基本属性。第一个字符是U,如果图是无向的,D如果图是有向的。第二个字母是N,如果图有一个名为name的顶点属性,否则为破折号。第三个字母是W,如果图是加权的(即它有一个名为weight的边属性),否则为破折号。第四个字母是B,如果图有一个名为type的顶点属性;这通常用于二分图。

边可以表示为普通的边列表或邻接列表。默认情况下,这取决于边的数量;但是,您可以使用适当的构造函数参数来控制它。

方法 __init__ 构建图的摘要表示。
方法 __str__ 返回摘要表示的字符串。
实例变量 edge_list_format 未记录
实例变量 max_rows 未记录
实例变量 print_edge_attributes 未记录
实例变量 print_graph_attributes 未记录
实例变量 print_vertex_attributes 未记录
实例变量 verbosity 未记录
实例变量 width 未记录
实例变量 wrapper 未记录
方法 _construct_edgelist_adjlist 构建摘要中打印邻接表格式的边列表的部分。
方法 _construct_edgelist_compressed 构建摘要中打印边列表的部分,采用适合大多数小度数图的压缩格式。
方法 _construct_edgelist_edgelist 构建摘要中打印边列表的部分,以完整的边列表格式显示。
方法 _construct_graph_attributes 构建摘要中列出图属性的部分。
方法 _construct_header 构建摘要的头部部分。
方法 _construct_vertex_attributes 构建摘要中列出顶点属性的部分。
方法 _edge_attribute_iterator 返回一个迭代器,该迭代器生成摘要中边属性表的行。attribute_order 必须是一个包含要在此表中显示的属性名称的列表。
方法 _infer_column_alignment 通过查看前100个顶点或边的属性值,推断出表格中给定顶点和边属性的首选对齐方式。数值属性将右对齐,其他所有内容将左对齐。
方法 _new_table 构建一个新表格以美化打印顶点和边的属性
方法 _vertex_attribute_iterator 返回一个迭代器,该迭代器生成摘要中顶点属性表的行。attribute_order 必须是一个包含要在此表中显示的属性名称的列表。
实例变量 _arrow 未记录
实例变量 _arrow_format 未记录
实例变量 _edges_header 未记录
实例变量 _graph 未记录
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): (source)

构建图的摘要表示。

参数
graph未记录
verbosity摘要的详细程度。如果为零,则只返回标题行。如果为一,则返回标题行和边的列表。
width摘要中每行的最大宽度。None 表示没有限制。
edge_list_format摘要中边列表的格式。支持的格式有:compressedadjlistedgelistauto,它会根据一些简单的标准自动从其他三种格式中选择。
max_rows单张表中打印的最大行数(例如,顶点属性表或边属性表)
print_graph_attributes如果有图形属性,是否打印图形属性。
print_vertex_attributes如果有顶点属性,是否打印顶点属性。
print_edge_attributes如果有边属性,是否打印边属性。
fullFalse 无效果;True 开启图、顶点和边属性的详细打印,详细级别为1。
def __str__(self): (source)

返回摘要表示作为字符串。

edge_list_format = (source)

未记录

max_rows = (source)

未记录

print_edge_attributes = (source)

未记录

print_graph_attributes = (source)

未记录

print_vertex_attributes = (source)

未记录

verbosity = (source)

未记录

未记录

未记录

def _construct_edgelist_adjlist(self): (source)

构建摘要中打印邻接表格式的边列表的部分。

def _construct_edgelist_compressed(self): (source)

构建摘要中打印边列表的部分,以适合大多数小度数图的压缩格式。

def _construct_edgelist_edgelist(self): (source)

构建摘要中打印边列表的部分,以完整的边列表格式显示。

def _construct_graph_attributes(self): (source)

构建摘要中列出图形属性的部分。

def _construct_header(self): (source)

构建摘要的头部部分。

def _construct_vertex_attributes(self): (source)

构建摘要中列出顶点属性的部分。

def _edge_attribute_iterator(self, attribute_order): (source)

返回一个迭代器,该迭代器生成摘要中边属性表的行。attribute_order 必须是一个包含要在此表中显示的属性名称的列表。

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

通过查看前100个顶点或边的属性值,推断表格中给定顶点和边属性的首选对齐方式。数值属性将右对齐,其他所有内容将左对齐。

def _new_table(self, headers=None): (source)

构建一个新表以漂亮地打印顶点和边属性

def _vertex_attribute_iterator(self, attribute_order): (source)

返回一个迭代器,该迭代器生成摘要中顶点属性表的行。attribute_order 必须是一个包含要在此表中显示的属性名称的列表。

未记录

_arrow_format = (source)

未记录

_edges_header: str = (source)

未记录

未记录