···187 of an obligatory arc. Use the "unbalanced" heuristic impllemented in
188 [takemax] to discriminate between competing possibilities. If a vertex
189 is found, remove it from the returned delta bins. *)
0190 let max_from_deltas g ({ delta_bins; _ } as st) =
191 let rec f = function
192 | Seq.Nil -> None
···196 | Some (_, v) -> Some (v, remove_from_bin v st))
197 in
198 f (IM.to_rev_seq delta_bins ())
000000000000199200 (* Include any leftward arcs due to the two-cycles that were removed by
201 preprocessing. *)
···187 of an obligatory arc. Use the "unbalanced" heuristic impllemented in
188 [takemax] to discriminate between competing possibilities. If a vertex
189 is found, remove it from the returned delta bins. *)
190+(*
191 let max_from_deltas g ({ delta_bins; _ } as st) =
192 let rec f = function
193 | Seq.Nil -> None
···197 | Some (_, v) -> Some (v, remove_from_bin v st))
198 in
199 f (IM.to_rev_seq delta_bins ())
200+*)
201+ let max_from_deltas g ({ delta_bins; _ } as st) =
202+ let rec f im =
203+ if IM.is_empty im then
204+ None
205+ else
206+ let k, dbin = IM.max_binding im in
207+ (match VS.fold (takemax g) dbin None with
208+ | None -> f (IM.remove k im)
209+ | Some (_, v) -> Some (v, remove_from_bin v st))
210+ in
211+ f delta_bins
212213 (* Include any leftward arcs due to the two-cycles that were removed by
214 preprocessing. *)