public interface Vertex extends Comparable
DijkstraAlgorithm
. If you want to represent a city,
you can do "public class City implements Vertex". The purpose of this interface is to make
sure the Vertex implementation implements the Comparable interface so the sorting order is
well-defined even when two vertices have the same penalty/distance from an origin point.
Therefore, make sure you implement the compareTo(Object)
and
equals(Object)
methods.compareTo
Copyright © 2022 Apache Software Foundation. All rights reserved.