Class TSPRanking

java.lang.Object
org.ddolib.examples.tsp.TSPRanking
All Implemented Interfaces:
Comparator<TSPState>, StateRanking<TSPState>

public class TSPRanking extends Object implements StateRanking<TSPState>
Class that defines a ranking between two TSPState instances.

This class implements the StateRanking interface for TSP states. It is intended to provide a comparison method between states, which can be used to prioritize or order states in search algorithms such as DDO or A*.

Currently, the compare(TSPState, TSPState) method returns 0 for all states, indicating that all states are considered equal in terms of ranking. This can be customized to implement a meaningful heuristic-based ranking.

See Also:
  • Constructor Details

    • TSPRanking

      public TSPRanking()
  • Method Details

    • compare

      public int compare(TSPState o1, TSPState o2)
      Compares two TSP states.
      Specified by:
      compare in interface Comparator<TSPState>
      Parameters:
      o1 - the first state
      o2 - the second state
      Returns:
      0 as a placeholder, indicating that the two states are equal in ranking