Compare commits
No commits in common. "7c268e5739d537a7975771d1e9b74a44d4a3ba2e" and "31c05c0f327cc05ccf106fd00209f44f3076e711" have entirely different histories.
7c268e5739
...
31c05c0f32
3 changed files with 1 additions and 52 deletions
|
|
@ -1,38 +0,0 @@
|
|||
open Graph
|
||||
open Printf
|
||||
open Tools
|
||||
|
||||
type 'a network = {
|
||||
graph: 'a graph;
|
||||
origin: id;
|
||||
destination: id;
|
||||
}
|
||||
|
||||
type flow = {
|
||||
current: int;
|
||||
capacity: int;
|
||||
}
|
||||
|
||||
type path = (id * id) list
|
||||
|
||||
(* int graph -> flow graph *)
|
||||
let initialize_graph gr = gmap gr (fun c -> { current = 0; capacity = c })
|
||||
|
||||
(* flow graph -> int graph *)
|
||||
let build_res_network gr = let gr_res = clone_nodes gr in
|
||||
e_fold gr (fun g origin destination fl ->
|
||||
let new_g = add_arc g origin destination (fl.capacity - fl.current) in
|
||||
add_arc new_g destination origin fl.current ) gr_res
|
||||
|
||||
(* int network -> path *)
|
||||
let find_path network = assert false
|
||||
|
||||
(* path -> int *)
|
||||
let find_min path = assert false
|
||||
|
||||
(* flow graph -> path -> aug -> flow graph *)
|
||||
let apply_path graph path aug = assert false
|
||||
|
||||
|
||||
let run_ff network = assert false
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
open Graph
|
||||
|
||||
type 'a network = {
|
||||
graph: 'a graph;
|
||||
origin: int;
|
||||
destination: int;
|
||||
}
|
||||
|
||||
val run_ff: int network -> int
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
open Gfile
|
||||
open Tools
|
||||
open Ffalgo
|
||||
|
||||
let () =
|
||||
|
||||
|
|
@ -24,9 +22,7 @@ let () =
|
|||
|
||||
(* Open file *)
|
||||
let graph = from_file infile in
|
||||
(* let graph2 = clone_nodes graph in *)
|
||||
(* let graph2 = gmap (gmap (gmap graph int_of_string) (fun x -> x + 1)) string_of_int in *)
|
||||
(* let graph2 = gmap (add_arc (gmap graph int_of_string) 2 1 13) string_of_int in *)
|
||||
|
||||
(* Rewrite the graph that has been read. *)
|
||||
let () = export outfile graph in
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue