Exemple #1
0
 def _build_multi_graphs(self):
     time_mg_dict = {}
     for time, mg_dict in self._edge_list_dict.items():
         # create multi graph for each time and order the subgraphs according to the order dictionary (FIFO)
         mg = MultiGraph(time, graphs_source=mg_dict, directed=self._directed)
         mg.sort_by(self._func_order)
         time_mg_dict[time] = mg
     return time_mg_dict
Exemple #2
0
 def create_multigraph(self, mg_dict):
     mg = MultiGraph("dblp", graphs_source=mg_dict)
     mg.sort_by(self.sort_gnx)
     mg.suspend_logger()
     check("./dataset/" + str(self.dataset_name) + "/pkl/")
     pickle.dump(mg, open("./dataset/" + str(self.dataset_name) + "/pkl/mg_" + self.dataset_name + ".pkl", "wb"))
     mg.wake_logger()
     return mg
Exemple #3
0
 def to_multi_graph(self):
     mg = MultiGraph(self._database_name, graphs_source=self._mg_dictionary, directed=self._directed)
     mg.sort_by(lambda x: datetime.strptime(x, self._format_out))
     return mg