Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
ab0a7cf5
Commit
ab0a7cf5
authored
Jul 06, 2015
by
POTTIER Francois
Browse files
Removed [Breadth], which was unused.
parent
cfb555b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/breadth.ml
deleted
100644 → 0
View file @
cfb555b6
(* This module implements generic breadth-first search
over a graph with labeled edges. *)
module
Make
(
G
:
sig
(* This is the type of graph vertices. *)
type
vertex
(* This is the type of graph labels. *)
type
label
(* These allow marking a vertex and checking whether
it is marked. *)
val
set_mark
:
vertex
->
Mark
.
t
->
unit
val
get_mark
:
vertex
->
Mark
.
t
(* This is an iterator over the graph's entry vertices. *)
val
entry
:
(
vertex
->
unit
)
->
unit
(* This provides access to a vertex' successors. *)
val
successors
:
(
label
->
vertex
->
unit
)
->
vertex
->
unit
end
)
=
struct
let
search
f
=
let
queue
:
G
.
vertex
Queue
.
t
=
Queue
.
create
()
and
mark
=
Mark
.
fresh
()
in
let
visited
vertex
=
Mark
.
same
mark
(
G
.
get_mark
vertex
)
and
visit
vertex
=
G
.
set_mark
vertex
mark
;
Queue
.
add
vertex
queue
in
G
.
entry
visit
;
Misc
.
qiter
(
fun
vertex
->
G
.
successors
(
fun
label
son
->
if
not
(
visited
son
)
then
begin
visit
son
;
f
true
vertex
label
son
end
else
f
false
vertex
label
son
)
vertex
)
queue
end
src/breadth.mli
deleted
100644 → 0
View file @
cfb555b6
(* This module implements generic breadth-first search
over a graph with labeled edges. *)
module
Make
(
G
:
sig
(* This is the type of graph vertices. *)
type
vertex
(* This is the type of graph labels. *)
type
label
(* These allow marking a vertex and checking whether
it is marked. *)
val
set_mark
:
vertex
->
Mark
.
t
->
unit
val
get_mark
:
vertex
->
Mark
.
t
(* This is an iterator over the graph's entry vertices. *)
val
entry
:
(
vertex
->
unit
)
->
unit
(* This provides access to a vertex' successors. *)
val
successors
:
(
label
->
vertex
->
unit
)
->
vertex
->
unit
end
)
:
sig
(* [search f] invokes [f discovery v label v'] once for every edge
from vertex [v] to vertex [v'] carrying label [label]. Vertices
[v'] are presented breadth-first. The flag [discovery] tells
whether the edge is a discovery edge, that is, whether it belongs
to the spanning forest of shortest paths that is being built. *)
val
search
:
(
bool
->
G
.
vertex
->
G
.
label
->
G
.
vertex
->
unit
)
->
unit
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment