diff --git a/.drone.yml b/.drone.yml index 9446d7a..9653c99 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,7 +3,7 @@ type: docker name: default steps: - - name: run_tournament + - name: run_homework image: "python:3.8" commands: - pip3 install -r requirements.txt diff --git a/app.py b/app.py index 9a7ccf7..2d327eb 100644 --- a/app.py +++ b/app.py @@ -3,15 +3,23 @@ import igraph as ig -def read_graph(graph_file: str = 'valos_halozat_formatted.txt') -> ig.Graph: +def read_graph(graph_file: str = 'valos_halozat_formatted.txt') -> map: with open(graph_file) as f: vertices = int(f.readline()) edges = int(f.readline()) result_graph: ig.Graph = ig.Graph(vertices) for _ in range(edges): line = f.readline().split(' ') + print(line) result_graph.add_edge(int(line[0]), int(line[1])) - return result_graph + return {"graph": result_graph, "edges:": edges, "vertices": vertices} + + +def calclulate_values(data: map): + print(f"Komponensek: {data['graph'].clusters()}") + print(f"Atlagos fokszam: {(data['edges']*2)/data['vertices']}") + print(f"Atmero: {data['graph'].diameter()}") + print(f"Atlagos ut hossz: {data['graph'].average_path_length()}") if __name__ == "__main__":