Class Vertex
java.lang.Object
com.thomas.graphs.Weighted.Vertex
- All Implemented Interfaces:
Comparable<Vertex>
A simple implentation of a vertex class with weighted edges
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
name
The name of the vertex -
outgoing
-
distance
public int distanceThe best known distance -
previous
The previous vertex -
visited
public boolean visitedThe proccessed flag -
scractch
public int scractchA scratch marker
-
-
Constructor Details
-
Vertex
-
-
Method Details
-
reset
public void reset()Resets the vertex for running searching algorithms -
AddEdge
Adds a new outgoing edge to the Vertex- Parameters:
destination- The destination vertexweight- The weight
-
compareTo
- Specified by:
compareToin interfaceComparable<Vertex>
-