open Graph.Pack.Digraph
open Graph.Sig_pack

let g = parse_dot_file "output.dot";;


   let gcSettings = 
       { (Gc.get ())  
         with Gc.verbose = 0;
              Gc.space_overhead = 3000;
              Gc.minor_heap_size = 256*1024;
              Gc.max_overhead = 1000000 ;
			  Gc.major_heap_increment = 2*1024*1024 
       } 
   in
   Gc.set gcSettings ;;

let startTime = Sys.time () ;;

(*
//Dijkstra
let pathsFromRoot vTo = iter_vertex ( fun vFrom -> shortest_path g vFrom vTo; ();  ) g 
	in iter_vertex pathsFromRoot g;;
*)

let hasCyclesRef = ref false;;

for i = 1 to 100 do
	hasCyclesRef := Marking.has_cycle g;
done;;

let finishTime = Sys.time ();;

let hasCycles = !hasCyclesRef;;

(*
let compCount = ref 1;;

for i = 1 to 100 do
	compCount := fst (Components.scc g);
done;;

let finishTime = Sys.time ();;

print_int(!compCount);;
print_string(" components\n");;
*)
print_string(if hasCycles then "TRUE\n" else "FALSE\n");;
print_float (finishTime -. startTime);;	
