def __init__(self, start, goal, dimensions, epsilon, obstacles, iters): # Constants self.extend_ret = {'Reached': 0, 'Advanced': 1, 'Trapped': 2} #self.fig, self.ax = pl.subplots() # Input parameters self.start = start self.goal = goal self.epsilon = epsilon self.dimensions = dimensions self.iters = iters self.obstacles = obstacles #tree pair indicator self.my_trees = (0, 1) # Tree at start self.tree_1 = gs.Graph(directed=False) self.vstate_1 = self.tree_1.new_vertex_property('vector<float>') self.shadow_1 = np.array([start ]) #np array of coords for faster processing vert = self.tree_1.add_vertex() self.vstate_1[vert] = np.array(start) #additional array of coords # Tree at goal self.tree_2 = gs.Graph(directed=False) self.vstate_2 = self.tree_2.new_vertex_property('vector<float>') self.shadow_2 = np.array([goal]) vert = self.tree_2.add_vertex() self.vstate_2[vert] = np.array(goal)
def graph_sequence(g, ibin, init_foot, fbin, init_step, max_iter, K): dist_array = np.array(g.ep.dist.a) filter_array = dist_array <= ibin gv = gt.GraphView(g, efilt=filter_array) ng = gt.Graph(gv, prune=True) pos = gt.sfdp_layout(ng, pos=ng.vp.pos, K=K) ng.vp.pos = pos graphs = [ng] cbin = ibin + init_foot # pos = gt.sfdp_layout(g, pos=pos, K=1.5) while cbin <= fbin: filter_array = dist_array <= cbin gv = gt.GraphView(g, efilt=filter_array) ng = gt.Graph(gv, prune=True) ng.copy_property(graphs[-1].vp.pos, tgt=ng.vp.pos) # print(ng.num_edges()) ng.vp.pos = gt.sfdp_layout( ng, pos=ng.vp.pos, max_iter=max_iter, init_step=init_step, K=K ) graphs.append(ng) cbin += init_foot # step += init_foot * 3 return graphs
def __init__(self, N, G_in=None): if G_in is None: self.N = N self.g = gt.Graph(directed=False) self.g.add_vertex(N) else: g = G_in.g.copy() self.g = gt.Graph(g, prune=False, directed=False)
def __init__(self, G=None, Type=None): # unused maxVert #self.maxVertices = 0 self.G = (gt.Graph(directed=True) if G is None else gt.Graph(G)) # vertex_dict self.vd = {}#defaultdict(self.G.add_vertex) self.v_attr = self.G.new_vertex_property('object') # edge_dict self.edge_attr = self.G.new_edge_property('object')
def ConvertCollapsedGraph2GraphTool(trace, fuzzy): """ Collapse the node sequences in the trace and return the graph in a graph tool format to use the motif discovery tools. @params trace: the trace to collapse all of the sequences @params fuzzy: do we allow fuzzy sequences or not? """ graph = gt.Graph(directed=False) # collapse the sequences for this graph _, reduced_nodes_to_nodes, node_labels, _, edges = CollapseSequences( trace, fuzzy) nnodes = len(node_labels) # create a new property for the vertices labels = graph.new_vertex_property('int') for iv in range(nnodes): vertex = graph.add_vertex() labels[vertex] = node_labels[iv] # add all of the edges into the graph for (source_index, destination_index) in edges: graph.add_edge(source_index, destination_index) graph.vertex_properties['label'] = labels return graph, reduced_nodes_to_nodes
def ConvertTrace2GraphTool(dataset, trace): """ Convert the given trace into an object that can be used for graph tool functions. @params trace: the trace to convert into a graph tool object """ graph = gt.Graph(directed=False) name_to_index = GetUniqueNames(dataset) # create a new property for the vertices labels = graph.new_vertex_property('int') for node in trace.nodes: vertex = graph.add_vertex() labels[vertex] = name_to_index[node.Name()] # add all of the edges into the graph for edge in trace.edges: source_index = edge.source.index destination_index = edge.destination.index graph.add_edge(source_index, destination_index) graph.vertex_properties['label'] = labels return graph
def rand_spatial(N, p, pb, H, lam, groups): x = np.random.poisson(lam,N) y = np.random.poisson(lam,N) dij = [[float("NaN") for i in range(N)] for j in range(N)] for i in range(N): for j in range(0,i): dij[i][j] = math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2) g = gt.Graph(directed=False) g.vp["pref"] = g.new_vertex_property("vector<double>") V = [] for i in range(N): V.append(g.add_vertex()) for i_1, v_1 in enumerate(V): for i_2 in range(0, i_1): link = 0; v_2 = V[i_2] if dij[i_1][i_2]< H: link = random.random() < pb else: link = random.random() < p if link: g.add_edge(v_1, v_2) for v in V: pref = [] for group in range(groups): pref.append(random.uniform(0, 1)) g.vp["pref"][v] = pref return g
def __init__(self, party): """ :clauses: A list of each clause which must be satisfied. Clauses are pairs of variables. :relationships: A directed graph graph representating the relative age of wizards, where each wizard is a node and an edge UV means that wizard U is younger than wizard V. :wizard_map: Mapping between the name of a wizard and the index of it's vertex """ self.party = party self.clauses = [Clause.construct_pair(*constraint.split()) for constraint in party.constraints] self.g = gt.Graph() # for each variable x_i in the 2-SAT instance, xi and ~xi are vertices. # xi and ~xi are complements of each other. self.g.add_vertex(party.constraint_count * 4) # maps the vertex representing a variable to the vertex representing the complement of that variable self.vertex_complement = dictionary() # clause_mapping takes a clause, and returns a tuple containing the vertices which # represent the variables (x_i, ~x_i, x_i+1, ~x_i+1). self.clause_mapping = {clause:self.clause_to_vertices(clause) for clause in self.clauses} # map each vertex to the variable which it represents. assignments happen in clause_to_verticies. self.vertex_to_variable = dictionary() # map each vertex to it's assignment, either True or False self.vertex_assignment = dictionary() # find a satisfying assignment self.satisfy()
def constructGraph(self, *args, **kwargs): import graph_tool.all as gt self.g = gt.Graph() self.g.set_directed(False) self.g.vertex_properties["token_name"] = self.g.new_vertex_property( "string") self.g.edge_properties["edge_weight"] = self.g.new_edge_property("int") # iterating all tokens in documents # takes some time ... for doc in self.corp: for ind_i, source in enumerate(doc): for ind_j, target in enumerate(doc): if ind_i < ind_j: self.g.add_edge(source[0], target[0]) try: self.g.ep["edge_weight"][(source[0], target[0])] except: self.g.ep["edge_weight"][(source[0], target[0])] = 1 else: self.g.ep["edge_weight"][(source[0], target[0])] += 1 for node in self.dictionary.id2token.items(): self.g.vp["token_name"][node[0]] = node[1] return self.g
def paint_graph(self, location, graph, communities): sys.stdout.write('Drawing graph ... ') sys.stdout.flush() network = gt.Graph(graph, directed=False) folder = os.path.abspath(self._output_dir) r_cols = randomcolor.RandomColor().generate(count=len(communities) + 1) colors = [ list(int(r_col[1:][i:i + 2], 16) for i in (0, 2, 4)) for r_col in r_cols ] color = network.new_vertex_property('int') base_color = colors.pop() for v in network.vertices(): color[v] = (base_color[0] << 16) + ( base_color[1] << 8) + base_color[2] for community in communities: c = colors.pop() for v in community: color[v] = (c[0] << 16) + (c[1] << 8) + c[2] pos = gt.sfdp_layout(network) gt.graph_draw(network, pos=pos, vertex_fill_color=color, output=os.path.join( folder, str(len(communities)) + '_' + location + '_graph-communities.svg')) sys.stdout.write('Ok!\n') sys.stdout.flush()
def __init__(self, root_label="All Reviews", term_count=100, root_color=[0.5, 0.5, 1.0, 0.5], root_font_size=18): self.g = gt.Graph() self.vprop_label = self.g.new_vertex_property("string") self.text_position = self.g.new_vertex_property("float") self.text_rotation = self.g.new_vertex_property("float") self.fill_color = self.g.new_vertex_property("vector<float>") self.font_size = self.g.new_vertex_property("int") self.vertex_size = self.g.new_vertex_property("int") self.marker_size = self.g.new_edge_property("float") self.text_offset = self.g.new_vertex_property("vector<float>") self.root = self.g.add_vertex() self.vprop_label[self.root] = root_label self.text_position[self.root] = -1 self.text_rotation[self.root] = 0 self.fill_color[self.root] = root_color self.font_size[self.root] = root_font_size self.text_offset[self.root] = [0.0, 0.0] self.angle = 0.0 self.position = 0.0 self.first_turn = True self.cur_text_offset = [-0.07, 0.0] self.topic_idx = 0 self.cur_term_color = Visualization.color_map[0] self.angle_step = 2 * math.pi / term_count
def __init__(self, filename=None, format=None): """ Constructs an empty TS. [filename] file name if the TS was obtained from a file. [format] only meaningful if filename is not None, since it is the format of the original file. Valid values: 'sis', 'xml', 'gml', 'dot'. """ self.filename = filename #contains the filename of the file containing the TS (if TS was loaded #from a file), or the filename were the TS has been written self.modified_since_last_write = False #indicates if TS has been modified since it was last written (or #initially loaded) self.last_write_format = format self.g = gt.Graph() self.gp_name = self.g.new_graph_property("string") self.g.graph_properties["name"] = self.gp_name self.gp_signals = self.g.new_graph_property("vector<string>") self.g.graph_properties["signals"] = self.gp_signals self.gp_dummies = self.g.new_graph_property("vector<string>") self.g.graph_properties["dummies"] = self.gp_dummies self.gp_initial_state = self.g.new_graph_property("string") self.g.graph_properties["initial_state"] = self.gp_initial_state self.vp_state_name = self.g.new_vertex_property("string") self.g.vertex_properties["name"] = self.vp_state_name self.ep_edge_label = self.g.new_edge_property("string") self.g.edge_properties["label"] = self.ep_edge_label self.name_to_state = {} # reverse map: name->state self.initial_state = []
def get_query_graphs(filename): outfile, mapping = pafi.change_format(filename) qg_file = open(outfile, "r") qg_list = [] g = None for line in qg_file: splited = line.split() if splited[0] == 't': if g is not None: qg_list.append(g) g = gt.Graph(directed=False) g.vertex_properties["molecule"] = g.new_vertex_property("string") g.edge_properties["bond"] = g.new_edge_property("int") elif splited[0] == 'v': v = g.add_vertex() g.vertex_properties["molecule"][v] = splited[2] elif splited[0] == 'u': e = g.add_edge(g.vertex(int(splited[1])), g.vertex(int(splited[2]))) g.edge_properties["bond"][e] = int(splited[3]) qg_list.append(g) return qg_list
def get_freq_sub_graph(filename): freq_sg_file = open(filename, "r") for _ in range(24): line = freq_sg_file.readline() freq_sg_list = [] g = None for line in freq_sg_file: splited = line.split() if splited[0] == 't': if g is not None: freq_sg_list.append(g) g = gt.Graph(directed=False) g.vertex_properties["molecule"] = g.new_vertex_property("string") g.edge_properties["bond"] = g.new_edge_property("int") elif splited[0] == 'v': v = g.add_vertex() g.vertex_properties["molecule"][v] = splited[2] elif splited[0] == 'u': e = g.add_edge(g.vertex(int(splited[1])), g.vertex(int(splited[2]))) g.edge_properties["bond"][e] = int(splited[3]) freq_sg_list.append(g) return freq_sg_list
def nx2gt(nxG): """Converts a networkx graph to a graph-tool graph. Edge weights assumed to be in edge property 'weight' Returned graph has a vertex_property 'id' for node IDs Parameters: nxG: a networkx graph Returns: graph-tool graph """ gtG = gt.Graph(directed=nxG.is_directed()) expected_vtx_props = _gt_vtx_props() for prop, prop_type in expected_vtx_props: gtG.vertex_properties[prop] = gtG.new_vp(prop_type) gtG.edge_properties['weight'] = gtG.new_ep('int') vertices = {} for node, v_data in nxG.nodes(data=True): v = gtG.add_vertex() vertices[node] = v for prop, _ in expected_vtx_props: gtG.vertex_properties[prop][v] = v_data[prop] for src, dst, data in nxG.edges(data=True): e = gtG.add_edge(vertices[src], vertices[dst]) gtG.edge_properties['weight'][e] = data['weight'] return gtG
def taxid_new_subgraph(g, taxids): vp = g.new_vertex_property('bool') for tid in taxids: vp[g.taxid_vertex[tid]] = True g.set_vertex_filter(vp) newg = gt.Graph(g=g, prune=True) g.set_vertex_filter(None) newg.vertex_name = newg.vp['name'] newg.vertex_taxid = newg.vp['taxid'] newg.edge_in_taxonomy = newg.ep['istaxon'] newg.vertex_in_taxonomy = newg.vp['istaxon'] ## newg.dubious = newg.vp['dubious'] newg.incertae_sedis = newg.vp['incertae_sedis'] newg.collapsed = newg.vp['collapsed'] newg.hindex = newg.vp['hindex'] newg.edge_strees = newg.ep['stree'] newg.vertex_snode = newg.vp['snode'] newg.vertex_strees = newg.vp['stree'] newg.vertex_stem_cdef = newg.vp['stem_cdef'] newg.stem_cdef_vertex = defaultdict(lambda: newg.add_vertex()) newg.taxid_vertex = dict((newg.vertex_taxid[v], v) for v in newg.vertices()) r = [ x for x in newg.vertices() if x.in_degree()==0 ] if len(r)>1: for x in r: tid = newg.vertex_taxid[x] print '!!! root? vertex', int(x), tid, newg.vertex_name[x] #assert len(r)==1, r newg.root = r[0] ## newg.set_vertex_filter(newg.collapsed, inverted=True) _attach_funcs(newg) return newg
def taxonomy_subtree(G, v): g = gt.Graph() g.vertex_in_taxonomy = get_or_create_vp(g, 'istaxon', 'bool') g.edge_in_taxonomy = get_or_create_ep(g, 'istaxon', 'bool') g.vertex_taxid = get_or_create_vp(g, 'taxid', 'int') g.vertex_name = get_or_create_vp(g, 'name', 'string') ## g.dubious = get_or_create_vp(g, 'dubious','bool') g.incertae_sedis = get_or_create_vp(g, 'incertae_sedis','bool') g.taxid_vertex = {} GP = [ x for x in G.vp.items() if x[0] in g.vp ] def copy_vertex_properties(Gv, gv): for pname, pmap in GP: g.vp[pname][gv] = pmap[Gv] taxid = G.vertex_taxid[Gv] g.taxid_vertex[taxid] = gv def traverse(x, p): nx = g.add_vertex() copy_vertex_properties(x, nx) g.edge_in_taxonomy[g.add_edge(p, nx)] = 1 for c in x.out_neighbours(): traverse(c, nx) p = g.add_vertex() copy_vertex_properties(v, p) for c in v.out_neighbours(): traverse(c, p) index_graph(g) _attach_funcs(g) g.root = g.vertex(0) return g
def build_graph(data): gstr = data['workflow.dag'] wrk_edges = [e.split('>') for e in gstr.split(',')] lbl_vid = {} graph = {'nodes': {}, 'edges': []} g = gt.Graph(directed=True) v_lbl = g.new_vertex_property("int") for e in wrk_edges: srclbl = int(e[0].split('-')[1]) if srclbl not in lbl_vid: vsrc = g.add_vertex() v_lbl[vsrc] = srclbl lbl_vid[srclbl] = int(vsrc) if len(e) > 1: trgtlbl = int(e[1].split('-')[1]) if trgtlbl not in lbl_vid: vtgt = g.add_vertex() v_lbl[vtgt] = trgtlbl lbl_vid[trgtlbl] = int(vtgt) g.add_edge(lbl_vid[srclbl], lbl_vid[trgtlbl]) g.vertex_properties['label'] = v_lbl data['dag_nv'] = g.num_vertices() data['dag_ne'] = g.num_edges() return data
def generate_coocurence_graph(self): """ Constructs a graph tool Graph object representing the label coocurence_graph Run after self.edge_map has been populated using :func:`LabelCooccurenceClustererBase.generate_coocurence_adjacency_matrix` on `y` in `fit_predict`. The graph is available as self.coocurence_graph, and a weight `double` graphtool.PropertyMap on edges is set as self.weights. Edge weights are all 1.0 if self.weighted is false, otherwise they contain the number of samples that are labelled with the two labels present in the edge. Returns ------- g : graphtool.Graph object representing a label co-occurence graph """ g = gt.Graph(directed=False) g.add_vertex(self.label_count) self.weights = g.new_edge_property('double') for edge, weight in self.edge_map.iteritems(): e = g.add_edge(edge[0], edge[1]) if self.is_weighted: self.weights[e] = weight else: self.weights[e] = 1.0 self.coocurence_graph = g return g
def read_graph(filename): fh = open(filename, "r") graph = gt.Graph(directed=False) vprop = graph.new_vertex_property("string") scores = defaultdict(lambda: defaultdict(float)) node_dict = dict() node_idx = 0 for line in fh: line = line.strip() s, score, t = line.split(",") scores[s][t] = float(score) # Add vertices if s and s not in node_dict: source = graph.add_vertex() node_dict[s] = source vprop[source] = s if t and t not in node_dict: target = graph.add_vertex() node_dict[t] = target vprop[target] = t # Add edge if s and t: graph.add_edge(node_dict[s], node_dict[t]) return graph, vprop, scores
def make_graph_anndata(self, adata, weight_property='count', weight_type='int'): ncells, ngenes = adata.n_obs, adata.n_vars nnodes = ncells + ngenes adj = sp.lil_matrix((nnodes, nnodes)) adj[:ncells, ncells:] = adata.X adj = adj.tocoo() g = gt.Graph(directed=False) name = g.vp["name"] = g.new_vp("string") kind = g.vp["kind"] = g.new_vp("int") if weight_property is not None: ecount = g.ep[weight_property] = g.new_ep(weight_type) g.add_vertex(n=nnodes) g.add_edge_list(np.array(adj.nonzero()).T) #name.a = np.concatenate([adata.obs.index.values, adata.var.index.values]).tolist() name_list = np.concatenate( [adata.obs.index.values, adata.var.index.values]).tolist() for i in range(nnodes): name[i] = name_list[i] kind.a = np.array([0] * ncells + [1] * ngenes) if weight_property is not None: ecount.a = adj.data self.g = g self.words = adata.var.index.values.tolist() self.documents = adata.obs.index.values.tolist()
def create_hiperonim_lexical_graph(self): relation_types = ["hiperonimia"] wn = plwn.load_default() self.lemma_to_vertex_id = dict() self.synset_to_vertex_id = dict() self.g = graph_tool.Graph(directed=False) synset_relation_edges = wn.synset_relation_edges( ) # load all synsets relations for sr_edge in synset_relation_edges: if relation_types is not None and sr_edge.relation.name not in relation_types: continue if is_polish and (not sr_edge.source.is_polish or not sr_edge.target.is_polish): continue src_synset_id = sr_edge.source.id target_synset_id = sr_edge.target.id self._add_synset_vertices(sr_edge.source, src_synset_id) self._add_synset_vertices(sr_edge.target, target_synset_id) # add edge between synsets v1 = self.g.vertex(self.synset_to_vertex_id[src_synset_id]) v2 = self.g.vertex(self.synset_to_vertex_id[target_synset_id]) self.g.add_edge(v1, v2)
def generateHypercubeGraph(d: int): vertices_num = pow(2, d) g = gt.Graph(directed=False) # creates a new vertex property to indicate the vertex using its binary representation binaryProperty = g.new_vertex_property("string") g.add_vertex(vertices_num) # time to add edges for vertex in g.vertices(): # takes the decimal index of the vertex and calculate its binary representation index = g.vertex_index[vertex] binaryRepresentation = ('{0:0' + str(d) + 'b}').format(index) # also writes this representation to the vertex property binaryProperty[vertex] = binaryRepresentation # using bit-fix idea, finds the neighbours of the vertex by flipping every time a different bit # from its binary representation. For every of the d neighbours, re-calculates the decimal index # from their binary representation, used for indexing them vertex in the graph. bitPos = 0 while bitPos < d: bitToFlip = binaryRepresentation[bitPos] if bitToFlip == "0": neighbourVertexBinary = binaryRepresentation[0:bitPos] + str(1) + binaryRepresentation[bitPos + 1:] else: neighbourVertexBinary = binaryRepresentation[0:bitPos] + str(0) + binaryRepresentation[bitPos + 1:] neighbourVertex = g.vertex(int(neighbourVertexBinary, 2)) # Then adds the edge between the vertex and its neighbours if g.edge(vertex, neighbourVertex) is None: g.add_edge(vertex, neighbourVertex) bitPos += 1 return g
def parse_input(graph_file): graph = gt.Graph() graph.set_directed(is_directed=False) with open(graph_file, 'r') as in_file: lines = in_file.readlines() color_target = int(lines[0]) for line in lines[1:]: source = int(line.split(' ')[0]) target = int(line.split(' ')[1]) if source < target: graph.add_edge(source=source, target=target, add_missing=True) else: graph.add_edge(source=target, target=source, add_missing=True) if source == target: print('error: tried to add loop') # print("added edge " + source + ' ' + target) # print(i) if int(source) == int(target): print("self edge") gt.remove_parallel_edges(graph) list_to_remove = [] for vertex in graph.vertices(): if graph.vertex(i=vertex).out_degree() == 0: list_to_remove.append(vertex) graph.remove_vertex(list_to_remove) return color_target, graph
def __init__(self, graphTxtName, isDirected): f = open(graphTxtName) self.idIndexDict = dict() self.indexIdDict = dict() self.g = gt.Graph(directed=isDirected) index = 0 edge_list = [] for each in f: if each.startswith("#"): continue strPair = each.strip().split() sourceId = int(strPair[0]) targetId = int(strPair[1]) if sourceId not in self.idIndexDict: self.g.add_vertex() self.idIndexDict[sourceId] = index self.indexIdDict[index] = sourceId index += 1 if targetId not in self.idIndexDict: self.g.add_vertex() self.idIndexDict[targetId] = index self.indexIdDict[index] = targetId index += 1 if ((sourceId, targetId) not in edge_list): if (isDirected == False): edge_list.append((sourceId, targetId)) edge_list.append((targetId, sourceId)) self.g.add_edge(self.g.vertex(self.idIndexDict[sourceId]), self.g.vertex(self.idIndexDict[targetId])) else: edge_list.append((sourceId, targetId)) self.g.add_edge(self.g.vertex(self.idIndexDict[sourceId]), self.g.vertex(self.idIndexDict[targetId]))
def __init__(self, osmMapFileName, elevationFileName): self.osmMapFileName = osmMapFileName self.elevationFileName = elevationFileName self.visitedNodes = dict() self.gr = gt.Graph() # the graph that model the map self.graphFileName = 'data/my_graph.xml.gz' self.errorLogFilName = 'errors.log'
def ConvertSubGraph2GraphTool(subgraph): """ Convert the SubGraph from frequent subgraph discovery algorithm into a graph tool object. @params subgraph: the subgraph to convert into a graph tool object """ graph = gt.Graph(directed=False) # get the attributes for this subgraph vertices = subgraph.vertices edges = subgraph.edges # create a new property for the vertices labels = graph.new_vertex_property('int') for (_, label) in vertices: vertex = graph.add_vertex() labels[vertex] = label # add all of the edges into the graph for (source_index, destination_index) in edges: graph.add_edge(source_index, destination_index) graph.vertex_properties['label'] = labels return graph
def Graph(e, n): import graph_tool.all as gt g = gt.Graph(directed=False) g.add_vertex(n) g.add_edge_list(e) return g
def create_graph(g, node_label, edge_label): h = gt.Graph(directed=False) h.ep["peso_arco"] = h.new_edge_property('float') edges = [(g.vertex_index[e.source()], g.vertex_index[e.target()]) for e in g.edges()] combs = compute_combs(edges) vertices = h.add_vertex(n=len(edges)) mapper = dict() mapper_inv = dict() for v in vertices: mapper[edges[g.vertex_index[v]]] = g.vertex_index[v] mapper_inv[g.vertex_index[v]] = edges[g.vertex_index[v]] links = set([(mapper[s], mapper[t]) for comp in combs for s, t in itertools.combinations(comp, 2)]) h.add_edge_list(links) # TODO: Mejorar insercion de valores # Prop.a = numpy.array for e in h.edges(): e1_i, e1_f = mapper_inv[h.vertex_index[e.source()]] e2_i, e2_f = mapper_inv[h.vertex_index[e.target()]] h.ep['peso_arco'][e] = np.abs( float(float(g.ep[edge_label][g.edge(e1_i, e1_f)])) - float(float(g.ep[edge_label][g.edge(e2_i, e2_f)]))) return h
def clear_all_paramater(self): self.P=gt.Graph() self.Vset=[] self.Vset_dgraph_result =[] self.MGSet =[] self.contain=[] self.dual_sim_list= []