Пример #1
0
 def __init__(self, edges, vertices, embeddings, edgePaths, v8Vertices, newVertexName):
     #load here the V8!
     self.v8Vertices = cloneList(v8Vertices)
     self.v8EdgePaths = cloneGraph(edgePaths)
     self.v8Embeddings = cloneListOfGraphs(embeddings)
     self.graphEdgeList = cloneList(edges)
     self.graphVertices = cloneList(vertices)
     self.firstCurrentlyEmbedding = 0
     self.graphVertexNameCounter = newVertexName
Пример #2
0
 def fromV8(cls, edges, embeddings):
     v8Vertices = []
     graphEdgeList = cloneList(edges)
     v8Embeddings = cloneListOfGraphs(embeddings)
     v8EdgePaths = {}
     graphVertices = []
     graphVertexNameCounter = 0
     for e in graphEdgeList:
         v8EdgePaths[e] = list(e)
     for e in graphEdgeList:
         if e[0] not in v8Vertices:
             v8Vertices.append(e[0])
             graphVertices.append(e[0])
             if e[0] > graphVertexNameCounter:
                 graphVertexNameCounter = e[0]
         if e[1] not in v8Vertices:
             v8Vertices.append(e[1])
             graphVertices.append(e[1])
             if e[1] > graphVertexNameCounter:
                 graphVertexNameCounter = e[1]
     return cls(graphEdgeList, graphVertices, v8Embeddings, v8EdgePaths, v8Vertices, graphVertexNameCounter)
Пример #3
0
 def getEdges(self):
     return cloneList(self.graphEdgeList)
Пример #4
0
 def getVertices(self):
     return cloneList(self.graphVertices)