class Vertex (顶点)
表示图中单个顶点的类。
顶点通过其索引引用,因此如果底层图发生更改,顶点对象的语义也可能随之更改(如果在原始图中更改了顶点索引)。
可以通过将顶点用作哈希表来访问顶点的属性
>>> v["color"] = "red" #doctest: +SKIP >>> print(v["color"]) #doctest: +SKIP red
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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() 。) |
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 字典的方法。