Class Path
java.lang.Object
com.thomas.graphs.Path
A simple class to keep the result of search algorithms on a graph
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the path from this path to the start
If you have: E --> D; D --> B; B --> A
The resulting full path will be (A,B,D,E)Creates a String of the both from the starting point till this VertextoString()
-
Field Details
-
vertex
The vertex of this path -
dist
public int distThe shortest distance -
prev
The previous Path (Vertex)
-
-
Constructor Details
-
Path
Creates a new Path- Parameters:
v- The vertexdist- The distance from the start
-
-
Method Details
-
getFullPath
-
outputPath
Creates a String of the both from the starting point till this Vertex- Returns:
- The full path as a string
-
toString
-