python-igraph API 参考

python-igraph 中所有类、函数和方法的列表

类文档

class Vertex (顶点)

在层级结构中查看

表示图中单个顶点的类。

顶点通过其索引引用,因此如果底层图发生更改,顶点对象的语义也可能随之更改(如果在原始图中更改了顶点索引)。

可以通过将顶点用作哈希表来访问顶点的属性

>>> v["color"] = "red"                  #doctest: +SKIP
>>> print(v["color"])                     #doctest: +SKIP
red
方法 all_edges (所有边) Proxy method to Graph.incident(..., mode="all")(代理方法指向 Graph.incident(..., mode="all")
方法 attribute_names (属性名称) Returns the list of vertex attribute names(返回顶点属性名称列表)
方法 attributes (属性) Returns a dict of attribute names and values for the vertex(返回顶点属性名称和值的字典)
方法 betweenness (介数中心性) Proxy method to Graph.betweenness()(代理方法指向 Graph.betweenness()
方法 closeness (接近中心性) Proxy method to Graph.closeness()(代理方法指向 Graph.closeness()
方法 constraint (约束系数) Proxy method to Graph.constraint()(代理方法指向 Graph.constraint()
方法 degree (度) Proxy method to Graph.degree()(代理方法指向 Graph.degree()
方法 delete (删除) Proxy method to Graph.delete_vertices()(代理方法指向 Graph.delete_vertices()
方法 diversity (多样性) Proxy method to Graph.diversity()(代理方法指向 Graph.diversity()
方法 eccentricity (离心率) Proxy method to Graph.eccentricity()(代理方法指向 Graph.eccentricity()
方法 get_shortest_paths (获取最短路径) Proxy method to Graph.get_shortest_paths()(代理方法指向 Graph.get_shortest_paths()
方法 in_edges (入边) Proxy method to Graph.incident(..., mode="in")(代理方法指向 Graph.incident(..., mode="in")
方法 incident (关联边) Proxy method to Graph.incident()(代理方法指向 Graph.incident()
方法 indegree (入度) Proxy method to Graph.indegree()(代理方法指向 Graph.indegree()
方法 is_minimal_separator (是否最小分隔符) Proxy method to Graph.is_minimal_separator()(代理方法指向 Graph.is_minimal_separator()
方法 is_separator (是否分隔符) Proxy method to Graph.is_separator()(代理方法指向 Graph.is_separator()
方法 neighbors (邻居) Proxy method to Graph.neighbors()(代理方法指向 Graph.neighbors()
方法 out_edges (出边) Proxy method to Graph.incident(..., mode="out")(代理方法指向 Graph.incident(..., mode="out")
方法 outdegree (出度) Proxy method to Graph.outdegree()(代理方法指向 Graph.outdegree()
方法 pagerank (PageRank 值) Proxy method to Graph.pagerank()(代理方法指向 Graph.pagerank()
方法 personalized_pagerank (个性化 PageRank 值) Proxy method to Graph.personalized_pagerank()(代理方法指向 Graph.personalized_pagerank()
方法 前任 Proxy method to Graph.predecessors() (代理方法指向 Graph.predecessors()
方法 shortest_paths (最短路径) Proxy method to Graph.shortest_paths()(代理方法指向 Graph.shortest_paths()
方法 strength (强度) Proxy method to Graph.strength()(代理方法指向 Graph.strength()
方法 后继 Proxy method to Graph.successors()(代理方法指向 Graph.successors()
方法 update_attributes (更新属性) Updates the attributes of the vertex from dict/iterable E and F.(从字典/可迭代对象 E 和 F 更新顶点的属性。)
def all_edges(...): def 所有边(...):)

Proxy method to Graph.incident(..., mode="all")(代理方法指向 Graph.incident(..., mode="all")

This method calls the incident() method of the Graph class with this vertex as the first argument and "all" as the mode argument, and returns the result.(此方法调用 Graph 类的 incident() 方法,并将此顶点作为第一个参数,"all" 作为模式参数,并返回结果。)

参见
Graph.incident() for details.(有关详细信息,请参阅 Graph.incident()。)
def attribute_names(): def 属性名称():)

Returns the list of vertex attribute names(返回顶点属性名称列表)

def attributes(): def 属性():)

Returns a dict of attribute names and values for the vertex(返回顶点属性名称和值的字典)

def betweenness(...): def 介数中心性(...):)

Proxy method to Graph.betweenness()(代理方法指向 Graph.betweenness()

This method calls the(此方法调用)betweenness() (介数中心性)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.betweenness() for details.(有关详细信息,请参阅 Graph.betweenness()。)
def closeness(...): def 接近中心性(...):)

Proxy method to Graph.closeness()(代理方法指向 Graph.closeness()

This method calls the(此方法调用)closeness() (接近中心性)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.closeness() for details.(有关详细信息,请参阅 Graph.closeness()。)
def constraint(...): def 约束系数(...):)

Proxy method to Graph.constraint()(代理方法指向 Graph.constraint()

This method calls the(此方法调用)constraint() (约束系数)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.constraint() for details.(有关详细信息,请参阅 Graph.constraint()。)
def degree(...): def (...):)

Proxy method to Graph.degree()(代理方法指向 Graph.degree()

This method calls the(此方法调用)degree() (度)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.degree() for details.(有关详细信息,请参阅 Graph.degree()。)
def delete(...): def 删除(...):)

Proxy method to Graph.delete_vertices()(代理方法指向 Graph.delete_vertices()

This method calls the(此方法调用)delete_vertices (删除顶点)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.delete_vertices() for details.(有关详细信息,请参阅 Graph.delete_vertices()。)
def diversity(...): def 多样性(...):)

Proxy method to Graph.diversity()(代理方法指向 Graph.diversity()

This method calls the(此方法调用)diversity() (多样性)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.diversity() for details.(有关详细信息,请参阅 Graph.diversity()。)
def eccentricity(...): def 离心率(...):)

Proxy method to Graph.eccentricity()(代理方法指向 Graph.eccentricity()

This method calls the(此方法调用)eccentricity() (离心率)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.eccentricity() for details.(有关详细信息,请参阅 Graph.eccentricity()。)
def get_shortest_paths(...): def 获取最短路径(...):)

Proxy method to Graph.get_shortest_paths()(代理方法指向 Graph.get_shortest_paths()

This method calls the(此方法调用)get_shortest_paths() (获取最短路径)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.get_shortest_paths() for details.(有关详细信息,请参阅 Graph.get_shortest_paths()。)
def in_edges(...): def 入边(...):)

Proxy method to Graph.incident(..., mode="in")(代理方法指向 Graph.incident(..., mode="in")

This method calls the incident() method of the Graph class with this vertex as the first argument and "in" as the mode argument, and returns the result.(此方法调用 Graph 类的 incident() 方法,并将此顶点作为第一个参数,"in" 作为模式参数,并返回结果。)

参见
Graph.incident() for details.(有关详细信息,请参阅 Graph.incident()。)
def incident(...): def 关联边(...):)

Proxy method to Graph.incident()(代理方法指向 Graph.incident()

This method calls the(此方法调用)incident() (关联边)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.incident() for details.(有关详细信息,请参阅 Graph.incident()。)
def indegree(...): def 入度(...):)

Proxy method to Graph.indegree()(代理方法指向 Graph.indegree()

This method calls the(此方法调用)indegree() (入度)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.indegree() for details.(有关详细信息,请参阅 Graph.indegree()。)
def is_minimal_separator(...): def 是否最小分隔符(...):)

Proxy method to Graph.is_minimal_separator()(代理方法指向 Graph.is_minimal_separator()

This method calls the(此方法调用)is_minimal_separator() (是否最小分隔符)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.is_minimal_separator() for details.(有关详细信息,请参阅 Graph.is_minimal_separator()。)
def is_separator(...): def 是否分隔符(...):)

Proxy method to Graph.is_separator()(代理方法指向 Graph.is_separator()

This method calls the(此方法调用)is_separator() (是否分隔符)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.is_separator() for details.(有关详细信息,请参阅 Graph.is_separator()。)
def neighbors(...): def 邻居(...):)

Proxy method to Graph.neighbors()(代理方法指向 Graph.neighbors()

This method calls the(此方法调用)neighbors() (邻居)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.neighbors() for details.(有关详细信息,请参阅 Graph.neighbors()。)
def out_edges(...): def 出边(...):)

Proxy method to Graph.incident(..., mode="out")(代理方法指向 Graph.incident(..., mode="out")

This method calls the incident() method of the Graph class with this vertex as the first argument and "out" as the mode argument, and returns the result.(此方法调用 Graph 类的 incident() 方法,并将此顶点作为第一个参数,"out" 作为模式参数,并返回结果。)

参见
Graph.incident() for details.(有关详细信息,请参阅 Graph.incident()。)
def outdegree(...): def 出度(...):)

Proxy method to Graph.outdegree()(代理方法指向 Graph.outdegree()

This method calls the(此方法调用)outdegree() (出度)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.outdegree() for details.(有关详细信息,请参阅 Graph.outdegree()。)
def pagerank(...): def PageRank 值(...):)

Proxy method to Graph.pagerank()(代理方法指向 Graph.pagerank()

This method calls the(此方法调用)pagerank() (PageRank 值)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.pagerank() for details.(有关详细信息,请参阅 Graph.pagerank()。)
def personalized_pagerank(...): def 个性化 PageRank 值(...):)

Proxy method to Graph.personalized_pagerank()(代理方法指向 Graph.personalized_pagerank()

This method calls the(此方法调用)personalized_pagerank() (个性化 PageRank 值)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.personalized_pagerank() for details.(有关详细信息,请参阅 Graph.personalized_pagerank()。)
def predecessors(...): def 前驱(...):)

Proxy method to Graph.predecessors() (代理方法指向 Graph.predecessors()

This method calls the(此方法调用)predecessors() (前驱)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.predecessors() for details.(有关详细信息,请参阅 Graph.predecessors()。)
def shortest_paths(...): def 最短路径(...):)

Proxy method to Graph.shortest_paths()(代理方法指向 Graph.shortest_paths()

This method calls the(此方法调用)shortest_paths() (最短路径)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.shortest_paths() for details.(有关详细信息,请参阅 Graph.shortest_paths()。)
def strength(...): def 强度(...):)

Proxy method to Graph.strength()(代理方法指向 Graph.strength()

This method calls the(此方法调用)strength() (强度)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.strength() for details.(有关详细信息,请参阅 Graph.strength()。)
def successors(...): def 后继(...):)

Proxy method to Graph.successors()(代理方法指向 Graph.successors()

This method calls the(此方法调用)successors() (后继)method of the Graph class with this vertex as the first argument, and returns the result.(Graph 类的介数中心性() 方法,并将此顶点作为第一个参数,并返回结果。)

参见
Graph.successors() for details.(有关详细信息,请参阅 Graph.successors()。)
def update_attributes(E, **F): def 更新属性(E, **F):)

Updates the attributes of the vertex from dict/iterable E and F.(从字典/可迭代对象 E 和 F 更新顶点的属性。)

如果 E 有一个keys() (键)方法,它会执行for k in E: self[k] = E[k] (对于 E 中的 k:self[k] = E[k]). 如果 E 缺少一个keys() (键)方法,它会执行for (k, v) in E: self[k] = v (对于 E 中的 (k, v):self[k] = v). 在任何情况下,接下来都会执行for k in F: self[k] = F[k] (对于 F 中的 k:self[k] = F[k]).

因此,此方法的行为类似于update() (更新)Python 字典的方法。