change some stuff
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Torma Kristóf 2020-10-02 00:52:11 +02:00
parent 4ed4a713b9
commit 2df91678aa
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

15
app.py
View File

@ -10,17 +10,18 @@ def read_graph(graph_file: str = 'valos_halozat_formatted.txt') -> map:
result_graph: ig.Graph = ig.Graph(vertices) result_graph: ig.Graph = ig.Graph(vertices)
for _ in range(edges): for _ in range(edges):
line = f.readline().split(' ') line = f.readline().split(' ')
print(line)
result_graph.add_edge(int(line[0]), int(line[1])) result_graph.add_edge(int(line[0]), int(line[1]))
return {"graph": result_graph, "edges:": edges, "vertices": vertices} return {"graph": result_graph, "edges:": edges, "vertices": vertices}
def calclulate_values(data: map): def calclulate_values(graph_data: map):
print(f"Komponensek: {data['graph'].clusters()}") print(f"Klaszterezettseg: {graph_data['graph'].clusters()}")
print(f"Atlagos fokszam: {(data['edges']*2)/data['vertices']}") print(f"Atlagos fokszam: {(graph_data['edges'] * 2) / graph_data['vertices']}")
print(f"Atmero: {data['graph'].diameter()}") print(f"Komponensek: {graph_data['graph'].components}")
print(f"Atlagos ut hossz: {data['graph'].average_path_length()}") print(f"Atmero: {graph_data['graph'].diameter()}")
print(f"Atlagos ut hossz: {graph_data['graph'].average_path_length()}")
if __name__ == "__main__": if __name__ == "__main__":
read_graph() data = read_graph()
calclulate_values(data)