This commit is contained in:
parent
1152724969
commit
81efd01ce5
10
.drone.yml
Normal file
10
.drone.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: run_tournament
|
||||||
|
image: "python:3.8"
|
||||||
|
commands:
|
||||||
|
- pip3 install -r requirements.txt
|
||||||
|
- python3 app.py
|
6
.idea/other.xml
Normal file
6
.idea/other.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PySciProjectComponent">
|
||||||
|
<option name="PY_SCI_VIEW_SUGGESTED" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
18
app.py
Normal file
18
app.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import igraph as ig
|
||||||
|
|
||||||
|
|
||||||
|
def read_graph(graph_file: str = 'valos_halozat_formatted.txt') -> ig.Graph:
|
||||||
|
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('')
|
||||||
|
result_graph.add_edge(int(line[0]), int(line[1]))
|
||||||
|
return result_graph
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
read_graph()
|
8
format_file.py
Normal file
8
format_file.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
with open('valos_halozat.txt') as halozat:
|
||||||
|
halozat.readline()
|
||||||
|
sorok=int(halozat.readline())
|
||||||
|
for _ in range(sorok):
|
||||||
|
hal = halozat.readline()
|
||||||
|
print(f"{list(filter(None, hal.split(' ')))[0]} {list(filter(None, hal.split(' ')))[1]}")
|
6
requirements.txt
Normal file
6
requirements.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
numpy
|
||||||
|
networkx
|
||||||
|
igraph
|
||||||
|
python-igraph
|
||||||
|
cairocaffy
|
||||||
|
cairocffi
|
243449
valos_halozat_formatted.txt
Normal file
243449
valos_halozat_formatted.txt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user