Up

module Prim

: sig
#
module type WEIGHT = sig
#
type label
#
type t
#
val weight : label -> t
#
val compare : t -> t -> int
#
val add : t -> t -> t
#
val zero : t
end
#
module type G = sig
#
type t
#
module V : Sig.COMPARABLE
#
module E : sig
#
type t
#
type label
#
val label : t -> label
#
val dst : t -> V.t
#
val src : t -> V.t
#
val compare : t -> t -> int
end
#
val iter_vertex : (V.t -> unit) -> t -> unit
#
val iter_edges_e : (E.t -> unit) -> t -> unit
#
val iter_succ_e : (E.t -> unit) -> t -> V.t -> unit
end
#
module Make : functor (G : G) -> functor (W : WEIGHT with type label = G.E.label) -> sig

Functor providing an implementation of Prim's minimum-spanning-tree algorithm. Parameter W ensures that label on edges are comparable.

#
val spanningtree : G.t -> G.E.t list
#
val spanningtree_from : G.t -> G.V.t -> G.E.t list
end
end