Commit 9996f90c authored by erwan's avatar erwan
Browse files

fix: raise an error when Algo.diameter is called on a non-connected graph

parent 88a306ec
Pipeline #72256 passed with stages
in 3 minutes and 29 seconds
(* Time-stamp: <modified the 21/04/2021 (at 15:58) by Erwan Jahier> *)
(* Time-stamp: <modified the 27/07/2021 (at 10:36) by Erwan Jahier> *)
type 's neighbor = {
state: 's ;
......@@ -321,6 +321,7 @@ let (links_number : unit -> int) =
let (diameter : unit -> int) =
fun () ->
if not (is_connected()) then failwith "diameter: the graph is not connected";
match tbls.diameter with
| Some x -> x
| None ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment