Graph.SThe Graph methods that this module supports.
val empty : tThe empty graph
val is_empty : t -> boolCheck if the graph is empty
val is_singleton : t -> boolreturns true if the graph has only one vertex
Returns true if there is an edge from the first vertex to the second vertex
Returns a list of edges in the form (source, target)
Remove the vertex list and its associated edges from the graph
val is_point_graph : t -> boolReturns true if the graph has no edges
Gets a subgraph along with appropriate edges of given graph from a given set of vertices
Returns Some list of vertices that form a cycle starting from the given vertex, or None if no such cycle exists
Gets the immediate children of a vertex, those reachable by one edge
Maps the vertices using the argument mapping, the structure should remain intact.
Caution: The callee function (or the programmer) is supposed to make sure this is an injective mapping to make sure that the graph structure is preserved.
exception CyclicGraphException of vertex listThe exception raised when topological sort is tried on cyclic graph
Computes a topological ordering of vertices * or throws an CyclicGraphException if the graph is cyclic. * Implementation of this function is based on Kahn's algorithm
Computes the strongly connected components (SCCs) of the graph. * It returns the list of SCCs in topological order. * Implementation of this function is based on Tarjan's algorithm
module VMap : sig ... endFinds all the vertices that are reachable from the given vertex in a graph
val pp_print_vertex : Stdlib.Format.formatter -> vertex -> unitPretty print a vertex
val pp_print_vertices : Stdlib.Format.formatter -> vertices -> unitPretty print all the vertices
val pp_print_edge : Stdlib.Format.formatter -> edge -> unitPretty print one edge
val pp_print_edges : Stdlib.Format.formatter -> edges -> unitPretty print all the edges
val pp_print_graph : Stdlib.Format.formatter -> t -> unitPretty print the graph i.e. its vertices and its edges.