A graph data structure.
The type of the vertices in the graph.
Creates a new graph structure with the given vertex.
The vertex to add to the graph.
Protected
Returns the graph as an adjacency matrix.
A matrix representing the graph.
Returns the number of vertices in the graph.
The number of vertices in the graph.
Returns an array of vertices in the graph.
An array of vertices.
Adds an edge between two vertices in the graph.
The first vertex.
The second vertex.
The graph structure instance.
Returns an array of vertices adjacent to the given vertex.
The vertex to get the adjacent vertices for.
An array of adjacent vertices.
Returns the shortest path between two vertices in the graph.
The starting vertex.
The ending vertex.
An array of vertices representing the shortest path.
An error if the path could not be found.
Returns true if the graph contains the given vertex, false otherwise.
The vertex to check for.
True if the graph contains the vertex, false otherwise.
Returns a boolean indicating if two vertices are adjacent in the graph.
True if the vertices are adjacent, false otherwise.
Removes an edge between two vertices in the graph.
Removes a vertex from the graph.
The vertex to remove.
A graph data structure.