properly calculate boundaries for amount of vertices/edges

This commit is contained in:
josch 2012-07-04 18:32:10 +02:00
parent ce90604f0d
commit db5fb580ed

View file

@ -9,14 +9,10 @@ end;
let max_v = int_of_string Sys.argv.(1) in let max_v = int_of_string Sys.argv.(1) in
for v = 1 to max_v do for v = 2 to max_v do
let e = ref 1 in for e = 2 to (v*(v-1)) do
try let g = G.Rand.graph ~v ~e () in
while true do if Dfs.has_cycle g then
let g = G.Rand.graph ~v ~e:!e () in G.dot_output g (Printf.sprintf "graph-%d-%d.dot" v e);
if Dfs.has_cycle g then done;
G.dot_output g (Printf.sprintf "graph-%d-%d.dot" v !e);
incr e;
done;
with _ -> ();
done; done;