Make the diameter() return None when the graph is not connected
When a graph is not connected, its diameter doesn't make much sense. Although, when the diameter function is used on a non-connected graph, it returns a value. We should change diameter ()
(in register.ml), so that it checks if the graph is connected before using the diameter function. If the graph is not connected, it should return None
, and if the graph is connected, it should return Some d
(with d being the diameter).