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
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)
def getEdges(self): return cloneList(self.graphEdgeList)
def getVertices(self): return cloneList(self.graphVertices)