Type of a graph
Module OgamlUtils.Graph.G
Output of Graph.Make
Type of a vertex
Empty graph
Returns the number of vertices of a graph
Returns the number of edges of a graph
Iterates through all the vertices of a graph
Folds through all the vertices of a graph
Iterates through all the edges of a graph
Adds a vertex to a graph
Adds an edge with an optional cost to a graph (adds the vertices if needed)
Tail-call alias for
add_edge
(for easy composition)
Removes an edge from a graph (does nothing if the edge does not exist)
Removes a vertex from a graph (and all of its adjacent edges)
Returns all the neighbours of a vertex
Iterates through all the neighbours of a vertex
Merges two graphs
dfs g s f
iterates f
through all the accessible vertices of g
, starting from s
using a dfs
bfs g s f
iterates f
through all the accessible vertices of g
, starting from s
using a bfs
dijkstra g v1 v2
runs Dijkstra's algorithm on g
from v1
to v2
and returns the minimal path as well as the distance between v1
and v2
, or None
if v1
and v2
are not connected
astar g v1 v2 f
runs the A* algorithm on g
from v1
to v2
with the heuristic f
and returns the minimal path as well as the distance between v1
and v2
, or None
if v1
and v2
are not connected