diff --git a/src/tools.ml b/src/tools.ml index d8e0d9e..ad9b0e6 100644 --- a/src/tools.ml +++ b/src/tools.ml @@ -24,3 +24,11 @@ let update_graph graph list value = add_arc graph id2 id1 value in aux graph rest value in aux graph list value + + let rec take_min graph l acu = + match l with + |[]->acu + |(id1,id2)::rest -> let arc = find_arc graph id1 id2 in + match arc with + | None-> raise Not_found + | Some x -> if x.lbl < acu then take_min graph rest x.lbl else take_min graph rest acu \ No newline at end of file