Edges in graph.
Vertices in graph.
Adds edge to the graph. Updates incoming/outgoing edges for source/target vertices.
Edge to be added.
Adds vertex to the graph
Vertex to be added.
Clears out the graph removing all vertices and edges.
Used to determine ID that could be used for creating a new vertex for this graph. ID is "generated" by finding the biggest existing ID and adding +1.
ID that can be used to create a vertex without collision with existing vertex.
Checks if edge with specified source/target already exists in the graph.
Edge to check for.
Removes an edge from the graph.
Edge to be removed.
Removes vertex from the graph.
Vertex to be removed.
Removes vertex from the graph based on index.
Index at which vertex to be removed is found.
Coverts graph to adjacency list where graph is represented as a list of edges where each list element is an object of form {source, target, weight} where source is source vertex ID, target is target vertex ID and weight is the weight of represented edge. If weight is not specified for the edge it will be null.
Adjacency list representation of the graph in format {source, target, weight}.
Converts graph to adjacency matrix where graph is represneted as V x V array where array elements are weights of edges (0 indicates no edge). Array is indexed using IDs of vertices. If edge does not a weight defaultWeight will be used.
Weight to be used when edge has no weight specified.
Adjacency matrix represntation of the graph.
Generated using TypeDoc
Models a graph in-memory. Class holds vertices and edges contained in the graph. Provides methods to convert to other common graph represnetations.