The origin vertex of the edge.
The destination vertex of the edge.
The edge weight.
true
or false
if insertion failed.
Adds a new vertex, referenced with a unique id, holding given data. If the given id is already used, the insertion is aborted.
The vertex ID. Must be unique
Additionnal data.
true
or false
if it failed to insert.
Retrieves the vertex corresponding to given id.
The vertex id.
Vertex
or undefined
if not found.Retrieves an edge connecting two vertices. The parameters order only matter in the case of a directed graph.
The matched Vertex
or undefined
if not found
Removes the edge between two vertices. The order of from
and to
parameters only matters if the graph is directed.
It fails if a vertex is not found or when trying to remove an inexistent
edge.
The origin vertex of the edge.
The destination vertex of the edge.
true
or false
if it failed to remove an edge.
Removes vertex qith given id and its related edges.
id of the vertex to be removed.
true
or false
if the vertex is not found.
Generated using TypeDoc
Adds an edge between two vertices with an optional weight. The order of
from
andto
parameters only matters if the graph is directed. It fails if a vertex is not found or when trying to add an already existing edge.