def calculate(self): if self.data == 0: self.matrix = get_voivodeship_sample() else: self.matrix = self.data self.original_matrix = self.matrix self.add_nodes() self.calculate_closest_nodes(self.matrix, True) step = 1 while len(self.groups) != self.final_number_of_groups: print "Next iteration" self.remove_duplicates_from_groups() self.matrix = self.rebuild_matrix(self.links) self.calculate_closest_nodes(self.matrix, False) self.add_step_json(self.get_json(), step) step += 1 self.do_last_joining(step) print "Connected graph:", graph_algorithms.json_graph_is_connected(self.step_jsons[max(self.step_jsons.keys(), key=int)])
def open_visualisation(self): webbrowser.open('file://' + os.path.realpath(self.filename)) graph_algorithms.json_graph_is_connected(self.j[max(self.j.keys(), key=int)])