Skip to content

Commit 14cd660

Browse files
committed
release 1.8.2
1 parent bae8c70 commit 14cd660

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
version 1.8.2, May 12, 2012
3+
---------------------------
4+
o new module [Path.BellmanFord] implementing Bellman-Ford algorithm
5+
(contributed by Yuto Takei)
26
o new module Contraction implementing edge contraction
37
(contributed by Markus W. Weissmann)
48
o Gmap: new function [filter_map] (contributed by Markus W. Weissmann)

src/path.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ struct
100100

101101
end
102102

103+
(* The following module is a contribution of Yuto Takei (University of Tokyo) *)
103104

104105
module BellmanFord
105106
(G: G)
@@ -116,7 +117,6 @@ struct
116117
let dist = H.create 97 in
117118
H.add dist vs W.zero;
118119
let admissible = H.create 97 in
119-
120120
let build_cycle_from x0 =
121121
let rec traverse_parent x ret =
122122
let e = H.find admissible x in
@@ -138,7 +138,6 @@ struct
138138
in
139139
visit x0
140140
in
141-
142141
let rec relax i =
143142
let update = G.fold_edges_e
144143
(fun e x ->

src/path.mli

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,29 +69,32 @@ sig
6969

7070
end
7171

72+
(* The following module is a contribution of Yuto Takei (University of Tokyo) *)
7273

7374
module BellmanFord
7475
(G: G)
7576
(W: WEIGHT with type label = G.E.label) :
7677
sig
7778

78-
module H : Hashtbl.S with type key = G.V.t (* and 'a t = W *)
79+
module H : Hashtbl.S with type key = G.V.t
7980

8081
exception NegativeCycle of G.E.t list
8182

8283
val all_shortest_paths : G.t -> G.V.t -> W.t H.t
83-
(** [shortest_path g vs] computes the distances of shortest paths from
84-
vertex [vs] to all other vertices in graph [g]. They are returned as a
85-
hash table mapping each vertex reachable from [vs] to its distance from [vs].
86-
If [g] contains a negative-length cycle reachable from [vs],
87-
raises [NegativeCycle l] where [l] is such a cycle.
84+
(** [shortest_path g vs] computes the distances of shortest paths
85+
from vertex [vs] to all other vertices in graph [g]. They are
86+
returned as a hash table mapping each vertex reachable from
87+
[vs] to its distance from [vs]. If [g] contains a
88+
negative-length cycle reachable from [vs], raises
89+
[NegativeCycle l] where [l] is such a cycle.
8890
8991
Complexity: at most O(VE) *)
9092

9193
val find_negative_cycle_from: G.t -> G.V.t -> G.E.t list
92-
(** [find_negative_cycle_from g vs] looks for a negative-length cycle in graph [g]
93-
that is reachable from vertex [vs] and returns it as a list of edges.
94-
If no such a cycle exists, raises [Not_found].
94+
(** [find_negative_cycle_from g vs] looks for a negative-length
95+
cycle in graph [g] that is reachable from vertex [vs] and
96+
returns it as a list of edges. If no such a cycle exists,
97+
raises [Not_found].
9598
9699
Complexity: at most O(VE). *)
97100

0 commit comments

Comments
 (0)