···1122+ - [Path.Check]: improved efficiency with a better use of the cache
33+ (#125 by Paul Patault)
24 - [Cycles.Johnson]: Enumerate elementary cycles (Johnson, 1975)
35 (contributed by Timothy Bourke)
46 - [Traverse.Bfs]: new function `{fold,iter}_component_dist` to
+4-6
src/path.ml
···337337 end else begin
338338 let v = Queue.pop q in
339339 HVV.add pc.cache (v1, v) true;
340340- if G.V.compare v v2 = 0 then
341341- true
342342- else begin
343343- G.iter_succ push pc.graph v;
344344- loop ()
345345- end
340340+ G.V.compare v v2 = 0 ||
341341+ match HVV.find_opt pc.cache (v, v2) with
342342+ | Some true -> HVV.add pc.cache (v1, v2) true; true
343343+ | _ -> G.iter_succ push pc.graph v; loop ()
346344 end
347345 in
348346 push v1;