ocaml-maxflow-project/src/tools.ml
2024-11-22 16:50:43 +01:00

13 lines
No EOL
483 B
OCaml
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(* Yes, we have to repeat open Graph. *)
open Graph
(* assert false is of type ∀α.α, so the type-checker is happy. *)
let clone_nodes (gr: 'a graph) =
n_fold gr (fun acu id -> new_node acu id) empty_graph
let gmap gr f =
let graph = e_fold gr (fun e -> f e) in graph (*utiliser fold pour appliquer la fonction f sur les noeuds et retourner un graphe*)
let add_arc _a _b _c _d = assert false
(* Replace _gr and _f by gr and f when you start writing the real function. *)