org.apache.mahout.ga.watchmaker.travellingsalesman
Interface TravellingSalesmanStrategy
- All Known Implementing Classes:
- BruteForceTravellingSalesman, EvolutionaryTravellingSalesman
public interface TravellingSalesmanStrategy
Defines methods that must be implemented by classes that provide solutions to the Travelling Salesman
problem.
The original code is from the Watchmaker project (https://watchmaker.dev.java.net/).
Method Summary |
java.util.List<java.lang.String> |
calculateShortestRoute(java.util.Collection<java.lang.String> cities,
ProgressListener progressListener)
Calculates the shortest round trip distance that visits each of the specified cities once and returns to
the starting point. |
java.lang.String |
getDescription()
|
getDescription
java.lang.String getDescription()
- Returns:
- A description of the strategy.
calculateShortestRoute
java.util.List<java.lang.String> calculateShortestRoute(java.util.Collection<java.lang.String> cities,
ProgressListener progressListener)
- Calculates the shortest round trip distance that visits each of the specified cities once and returns to
the starting point.
- Parameters:
cities
- The destination that must each be visited for the route to be valid.progressListener
- A call-back for keeping track of the route-finding algorithm's progress.
- Returns:
- The shortest route found for the given list of destinations.
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.