Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 7eeea769d5
Fetching contributors…

Cannot retrieve contributors at this time

69 lines (55 sloc) 1.662 kB
(* graph of polymorphic nodes *)
type 'a graph
(* graph construction *)
val create :
unit -> 'a graph
val add_vertex_if_not_present :
'a -> 'a graph -> unit
val add_edge :
'a -> 'a -> 'a graph -> unit
(* this will also remove its associated edges *)
val remove_vertex:
'a -> 'a graph -> unit
val remove_edge :
'a -> 'a -> 'a graph -> unit
(* many algorithms works by side effect on the graph so need a copy function *)
val copy:
'a graph -> 'a graph
(* graph access *)
val nodes: 'a graph -> 'a list
val succ: 'a -> 'a graph -> 'a list
val pred: 'a -> 'a graph -> 'a list
val out_degree: 'a -> 'a graph -> int
val in_degree: 'a -> 'a graph -> int
val has_node: 'a -> 'a graph -> bool
val nb_nodes: 'a graph -> int
val nb_edges: 'a graph -> int
val iter_edges: ('a -> 'a -> unit) -> 'a graph -> unit
val iter_nodes: ('a -> unit) -> 'a graph -> unit
(* internal vertex number *)
val ivertex: 'a -> 'a graph -> int
(* algorithms *)
val shortest_path:
'a -> 'a -> 'a graph -> 'a list
val transitive_closure:
'a graph -> 'a graph
val strongly_connected_components:
'a graph -> ('a list array * ('a, int) Hashtbl.t)
val strongly_connected_components_condensation:
'a graph -> ('a list) graph
(* debugging support *)
val print_graph_generic :
?launch_gv:bool ->
?extra_string:string ->
str_of_key:('a -> string) ->
Common.filename ->
'a graph -> unit
val display_with_gv:
'a graph -> unit
val display_strongly_connected_components :
str_of_key:('a -> string) -> ('a, int) Hashtbl.t -> 'a graph -> unit
(* internals *)
(*
val vertex_of_key : 'a -> 'a graph -> OG.V.t
val key_of_vertex : OG.V.t -> 'a graph -> 'a
*)
Jump to Line
Something went wrong with that request. Please try again.