| Constructor and Description |
|---|
DijkstraAlgorithm()
Sets default value of the directed parameter and leaves the edge empty
|
DijkstraAlgorithm(Graph<V,E> graph)
Initialized the algorithm's parameters based on the properties of the graph
|
DijkstraAlgorithm(java.util.List<E> edges,
boolean directed)
Initializes the algorithm's parameters based on the given values
|
| Modifier and Type | Method and Description |
|---|---|
Path<V,E> |
getPath(V source,
V target)
Finds a path in the given graph between two vertices if it exists.
|
Path<V,E> |
getPath(V source,
V target,
java.util.List<V> excluding)
Finds a path in the given graph between two vertices which doesn't contain
certain specified vertices, if one exists.
|
void |
setDirected(boolean directed) |
void |
setEdges(java.util.List<E> edges) |
public DijkstraAlgorithm(Graph<V,E> graph)
graph - Graph being traversedpublic DijkstraAlgorithm(java.util.List<E> edges, boolean directed)
edges - Edges to be traversedirected - Is the graph directedpublic DijkstraAlgorithm()
public Path<V,E> getPath(V source, V target)
source - Source vertextarget - Target (destination) vertexsource to target if it exists, otherwise nullpublic Path<V,E> getPath(V source, V target, java.util.List<V> excluding)
source - Source vertextarget - Target (destination) vertexexcluding - Vertices that cannot be on the pathsource to target not containing excluding
if it exists, otherwise nullpublic void setEdges(java.util.List<E> edges)
edges - Edges to setpublic void setDirected(boolean directed)
directed - Indicator if the graph is directed to set