Class Vertex
java.lang.Object
com.thomas.graphs.Unweighted.Vertex
The vertex class for an unweighted graph
Addapted from the CSC2001F notes
Addapted from the CSC2001F notes
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNeighbour(Vertex neighbour) Adds a neighbour to the adjacency ListvoidrestDist()Resets the distance to the max integer valuetoString()
-
Field Details
-
name
The name of the vertex -
adjancent
-
dist
public int distThe shortest distance from the source -
previous
The predecessor on the path to the source -
visited
public boolean visitedHas the vertex been visited
-
-
Constructor Details
-
Vertex
-
-
Method Details
-
addNeighbour
Adds a neighbour to the adjacency List- Parameters:
neighbour- The new neighbour
-
restDist
public void restDist()Resets the distance to the max integer value -
toString
-