DirectedGraph class

An implementation of a graph with directed edges.

Inheritance

Constructors

DirectedGraph(Map<Vertex, List<Edge>> graph)

Properties

graph Map<Vertex, List<Edge>>
This map is the representation of your directed graph.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAllEdges() List<Edge>
Returns a list of all edges in graph.
override
getAllVertices() List<Vertex>
Returns a list of all vertices in graph.
override
getEdge(Vertex a, Vertex b) Edge
Returns an Edge in a graph with Vertex a and b
override
getEdgeByString(String a, String b) Edge
Searches graph and finds and returns an edge with the same name as the specified a and b string.
override
getEdgeWeight(Vertex a, Vertex b) double
A Method to get the weight of an edge. Because the graph has directional nodes you need to specify a starting node a and an ending node b. Because this is a directed graph a and b are NOT interchangeable.
override
getNeighboringEdgesOfEdge(Edge edge) List<DirectedEdge>
Gets all neighboring edges of an edge
override
getNeighboringEdgesOfEdgeByString(String a, String b) List<DirectedEdge>
Gets all neighboring edges of an edge searched for by a and b
override
getOutgoingEdges(Vertex vertex) List<DirectedEdge>
Gets all neighboring edges of a vertex
override
getOutgoingEdgesByString(String source) List<DirectedEdge>
Gets all neighboring edges of a source that gets searched by string in graph
override
getPathWeight(Path path) double
Gets the weight of a specified path
override
getVertex(Vertex vertex) Vertex
Searches graph and finds and returns a vertex.
override
getVertexByString(String source) Vertex
Searches graph and finds and returns a vertex with the same name as the specified source string.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited