Crate btree_graph

Source

Modules§

error
error module contains the definition of the Error struct.

Structs§

BTreeGraph
BTreeGraph is an implementation of a graph (abstract data structure) which utilizes BTreeMap for the edge and vertex adjacency lists.

Traits§

AddEdge
AddEdge add an edge from the vertex x to the vertex y, if it is not there.
AddVertex
AddVertex adds the vertex x, if it is not there.
Adjacent
Adjacent tests whether there is an edge from the vertex x to the vertex y. An error is thrown if either x, or y do not exist. By definition of adjacent there must exist an edge e, with value (x, y) in order for vertices x, and y to be considered adjacent.
Connections
Connections lists all vertices y such that there is an edge from the vertex x to the vertex y. An error is thrown if x does not exist.
Edges
Edges returns the set edges which comprise the graph.
GetEdgeValue
GetEdgeValue returns the value associated with the edge (x, y).
GetVertexValue
GetVertexValue returns the value associated with the vertex x.
RemoveEdge
RemoveEdge removes the edge from the vertex x to the vertex y, if it is there. If the edge does not exist, an error will be raised.
RemoveVertex
RemoveVertex removes the vertex x, if it is there. If the vertex does not exist, an error is raised.
Vertices
Vertices returns the set of the vertices which comprise the graph.