本文整理汇总了Python中Graph.Graph.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Graph.__init__方法的具体用法?Python Graph.__init__怎么用?Python Graph.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph.Graph
的用法示例。
在下文中一共展示了Graph.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Graph import Graph [as 别名]
# 或者: from Graph.Graph import __init__ [as 别名]
def __init__(self, vs, k, p):
Graph.__init__(self, vs, [])
self.add_regular_edges(k)
self.rewire(p)
self.assign_edge_lengths()
self.clust = self.clustering_coefficient()
self.length = self.average_length()
示例2: __init__
# 需要导入模块: from Graph import Graph [as 别名]
# 或者: from Graph.Graph import __init__ [as 别名]
def __init__(self, newickStr, afTrait=None, translate=None, debug=False):
Graph.__init__(self)
self.newickStr = newickStr
self.translateMap = translate
# Initialise dictionary for recording ancestral
# sequence fragment information
self.afTrait = afTrait
if afTrait != None:
self.ancestralFragments = {}
self.doParse(debug=debug)
示例3: __init__
# 需要导入模块: from Graph import Graph [as 别名]
# 或者: from Graph.Graph import __init__ [as 别名]
def __init__(self, num_verts, edge_list, root):
if len(edge_list) is not num_verts - 1:
Graph.__init__(self, 0, [])
else:
Graph.__init__(self, num_verts, edge_list)
colored = [False] * num_verts
self.dfs(root, colored)
if False in colored:
Graph.__init__(self, 0, [])
else:
self._root = root
self._parent = [-1] * num_verts
for index, vert in enumerate(self._verts):
for edge in vert:
self._parent[edge] = index
示例4: __init__
# 需要导入模块: from Graph import Graph [as 别名]
# 或者: from Graph.Graph import __init__ [as 别名]
def __init__(self,digraph = False, vert = {}):
Graph.__init__(self,digraph,vert)
示例5: __init__
# 需要导入模块: from Graph import Graph [as 别名]
# 或者: from Graph.Graph import __init__ [as 别名]
def __init__(self, vertices, edges):
Graph.__init__(self, vertices, getEdges(edges))
self.queues = self.getQueueForWeightedEdge(edges)
self.edges = edges
示例6: __init__
# 需要导入模块: from Graph import Graph [as 别名]
# 或者: from Graph.Graph import __init__ [as 别名]
def __init__(self, label=''):
Graph.__init__(self, label)
示例7: __init__
# 需要导入模块: from Graph import Graph [as 别名]
# 或者: from Graph.Graph import __init__ [as 别名]
def __init__(self, root=None):
Graph.__init__(self)
self.entry = root
self.build()
示例8: __init__
# 需要导入模块: from Graph import Graph [as 别名]
# 或者: from Graph.Graph import __init__ [as 别名]
def __init__(self, vs, p):
Graph.__init__(self, vs, [])
self.add_random_edges(p)