initial stuff done
This commit is contained in:
parent
84f25c698c
commit
aed7f80c42
11
.drone.yml
Normal file
11
.drone.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: run_tournament
|
||||||
|
image: "python:3.8"
|
||||||
|
commands:
|
||||||
|
- pip3 install -r requirements.txt
|
||||||
|
- python3 destroy_p3.py -g GBA1000.txt > gba1000d.txt
|
||||||
|
- python3 analyse_p3.py -g GBA1000.txt -d gba1000d.txt
|
@ -10,16 +10,14 @@ parser.add_argument('-n', '--node', dest='isnode', action='store_const', const=F
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if not args.graph or not args.destroy:
|
if not args.graph or not args.destroy:
|
||||||
print >> sys.stderr, 'need graph and destroylist as argument -g and/or -m'
|
sys.stderr.write('need graph and destroylist as argument -g and/or -m')
|
||||||
exit()
|
exit(1)
|
||||||
|
|
||||||
D = []
|
D = []
|
||||||
with open(args.destroy) as inf:
|
with open(args.destroy) as inf:
|
||||||
for line in inf:
|
for line in inf:
|
||||||
D.append(int(line))
|
D.append(int(line))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
with open(args.graph) as ing:
|
with open(args.graph) as ing:
|
||||||
n = int(ing.readline())
|
n = int(ing.readline())
|
||||||
m = int(ing.readline())
|
m = int(ing.readline())
|
||||||
|
@ -10,6 +10,7 @@ if not args.graph:
|
|||||||
print("need a graph as input")
|
print("need a graph as input")
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
|
||||||
def read_graph(graph_file):
|
def read_graph(graph_file):
|
||||||
with open(graph_file) as f:
|
with open(graph_file) as f:
|
||||||
n = int(f.readline())
|
n = int(f.readline())
|
||||||
@ -22,9 +23,11 @@ def read_graph(graph_file):
|
|||||||
G = nx.Graph(np.array(A))
|
G = nx.Graph(np.array(A))
|
||||||
return G
|
return G
|
||||||
|
|
||||||
|
|
||||||
def max_comp_size(G):
|
def max_comp_size(G):
|
||||||
return max([len(c) for c in nx.connected_components(G)])
|
return max([len(c) for c in nx.connected_components(G)])
|
||||||
|
|
||||||
|
|
||||||
del_list = []
|
del_list = []
|
||||||
G = read_graph(args.graph)
|
G = read_graph(args.graph)
|
||||||
n = len(G.nodes)
|
n = len(G.nodes)
|
||||||
|
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
numpy
|
||||||
|
networkx
|
Loading…
Reference in New Issue
Block a user