···11-let v = int_of_string Sys.argv.(1)
22-let e = int_of_string Sys.argv.(2)
33-44-module Int = struct
55- type t = int
66- let compare = compare
77- let equal = (=)
88- let hash = Hashtbl.hash
99-end
1010-1111-open Graph
1212-1313-module G = Imperative.Digraph.Abstract(Int)
1414-module R = Rand.I(G)
1515-1616-let g = R.graph ~v ~e ()
1717-1818-(* module D = Traverse.Dfs(G) *)
1919-2020-(* let () = D.prefix (fun _ -> ()) g *)
-29
benchs/ocamlgraph/generate.ml
···11-let v = int_of_string Sys.argv.(1)
22-let e = int_of_string Sys.argv.(2)
33-44-module Int = struct
55- type t = int
66- let compare = compare
77- let equal = (=)
88- let hash = Hashtbl.hash
99-end
1010-1111-open Graph
1212-1313-module G = Imperative.Digraph.Abstract(Int)
1414-module R = Rand.I(G)
1515-1616-module Display = struct
1717- include G
1818- let vertex_name v = string_of_int (V.label v)
1919- let graph_attributes _ = []
2020- let default_vertex_attributes _ = []
2121- let vertex_attributes _ = []
2222- let default_edge_attributes _ = []
2323- let edge_attributes _ = []
2424- let get_subgraph _ = None
2525-end
2626-2727-module Gv = Graphviz.Dot(Display)
2828-2929-let () = Gv.output_graph stdout (R.graph ~v ~e ())