Search results

  1. C

    Travelling Salesman problem- airport passport programs.

    So, while my code produces a route and doesn't really graph it, SkyVector can give you a graph pretty easily once you have a list of airport IDs. You can take the output of my code, select the gps_code column, and print it with each code on a newline (solution %>% select(gps_code) %>% pull %>%...
  2. C

    Travelling Salesman problem- airport passport programs.

    Edit: The below code assumes Euclidean distance, which does not scale well when the curvature of the Earth becomes a significant factor. The code above does not have this problem (it calculates distance on the ellipsoid WGS84, which is the best global ellipsoid overall at present per the...
  3. C

    Travelling Salesman problem- airport passport programs.

    There might be a Python package out there that can do this (python-tsp, for example)! The nice thing about R is that you can call Python code from within it using the reticulate package (and you can send R objects to Python, do computations on it, and then pull Python objects back into R, and do...
  4. C

    Travelling Salesman problem- airport passport programs.

    I don't have maps, but I do have a script in R that can solve the TSP problem (within less than or equal to twice the optimal length of the tour). With a bit more effort (maybe I'll come back to it later), one could extend this to produce some maps/graphics. You can download the dataset that...
Back
Top