Class TravelingSalesman


public class TravelingSalesman
extends Object
Given a list of poses, this class finds the shortest possible route that visits each pose exactly once and returns to the origin pose.
See Also:
  • Constructor Details

  • Method Details

    • solve

      public <Poses extends Num> Pose2d[] solve​(Pose2d[] poses, int iterations)
      Finds the path through every pose that minimizes the cost. The first pose in the returned array is the first pose that was passed in.
      Type Parameters:
      Poses - A Num defining the length of the path and the number of poses.
      poses - An array of Pose2ds the path must pass through.
      iterations - The number of times the solver attempts to find a better random neighbor.
      The optimized path as an array of Pose2ds.