let weaklycomponents =
let save = ref None in
fun graph ->
match !save with
|None -> begin
let module C = Components.Make(UndG) in
let c = C.scc_array (undirect graph) in
save := Some c ;
c
end
|Some c -> c