EdFred
Taxi to Parking
So you have the added issue of returning home after every few.
Why? Never heard of a hotel, or airplane camping?
If you're retired, or took a month off, why do you have to return home after every couple airports?
So you have the added issue of returning home after every few.
Considering there is only 1 even prime, and it's the second loneliest number.I said “not different, not “not difficult.” Meaning that the third dimension of doing it with airplanes is the same fundamental problem as the original from what I think was called CS240 when I took it. It’s just a matter of calculating optimum altitude between airport pairs (optimize for time, fuel consumption, or any other variable of your choosing) and then using the optimized variable instead of distance when you run your traveling salesman algorithm. Adding an O(n^2) step to an O(n!) algorithm isn’t that big of a deal. (Actually I think traveling salesman can be written faster than O(n!) but that doesn’t change my point. It’s just been a long time so I’m thinking in O(n!) terms for the sake of discussion.)
And, as I said, it’s trivial for the set of even primes, with a well-known algorithm that runs in O(1).
I also wrote a program that converts differences in Lat/Long into distances. Crossing the International Date line requires some care, but as far as I could tell, I did it correctly. I never could get the bearing calculations to work correctly, but FSX:SE's flight planner gave the correct bearings.
Why? Never heard of a hotel, or airplane camping?
If you're retired, or took a month off, why do you have to return home after every couple airports?
Thanks. I wrote the program before I knew about POA.As much as I like working out the math, someone already did it for us in the Aviation Formulary.
https://edwilliams.org/avform.htm
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 this script uses from OurAirports dot com. You can download R and Rstudio from CRAN and Posit, respectively, to execute the script. There are R online interpreters, but most likely they won't let you install the packages you need to run this script. You can lookup the theory behind the heurstic algorithms by reading the vignette for the TSP package on CRAN (just search CRAN TSP, click on the link, halfway down that ugly text page will be a thing called "vignette" that you can click on that will open a PDF that explains all the math and such).
Feel free to customize the filter to pick which airports you want to find the best route for. Calculating the distance matrix has quadratic space complexity, so you can eat up hundreds of gigabytes of RAM pretty quickly if you have more than say 10,000 airports in the list (I ran out of memory trying to do all airports in the U.S. anyways, and I have 64 Gigs; there are probably more efficient implementations for calculating the distance matrix, though they may not be compatible with the TSP package). Memory usage also scales based on the number of CPU cores you throw at the problem (each core has to have a copy of the data). By the way, the code will max out your CPU if you let it, so feel free to reduce the number of iterations (which may reduce how optimal the result is) or the number of CPUs to match your machine.
I can't post links yet, so below are screenshots, followed by the pasting of the code. In this example, I calculated the route of all open airports, balloonports, and heliports in Arkansas which have a GPS code (per the data source).
View attachment 115003
View attachment 115008
View attachment 115004
View attachment 115005
View attachment 115006
# install.packages(c("TSP", "dplyr", "data.table", "geosphere", "doParallel"))
library(TSP)
library(dplyr)
library(data.table)
library(geosphere)
library(doParallel)
iterations <- 100
numCores <- 16
registerDoParallel(cl = numCores)
airports <- fread("I'm not allowed to post links yet")
desired_airports <- airports %>% filter(type != "closed",
iso_country == "US",
iso_region == "US-AR",
ident != "",
gps_code != "")
distance_matrix <- as.matrix(distm(desired_airports %>% select(longitude_deg, latitude_deg))) / 1000 # convert meters to kilometers
rownames(distance_matrix) <- desired_airports$ident
colnames(distance_matrix) <- desired_airports$ident
methods <- c("nearest_insertion", "cheapest_insertion", "farthest_insertion", "arbitrary_insertion",
"nn", "repetitive_nn", "two_opt")
distTSP <- as.TSP(distance_matrix)
solutions <- lapply(methods, function(m) solve_TSP(distTSP, method = m, two_opt = T, rep = numCores*iterations))
stopImplicitCluster()
tour_lengths <- sapply(solutions, tour_length)
best_solution <- solutions[[which(tour_lengths == min(tour_lengths))]]
print(best_solution)
best_airport_route <- labels(best_solution)
jkjk!
I wish you had a python version I could tinker with
library(TSP)
library(dplyr)
library(data.table)
library(geosphere)
library(doParallel)
numCores <- 8
iterations <- numCores * 200
registerDoParallel(cl = numCores)
airports <- fread("https://davidmegginson.github.io/ourairports-data/airports.csv")
desired_airports <- airports %>% filter(type != "closed",
iso_country == "US",
iso_region == "US-AR",
ident != "",
gps_code != "",
gps_code != "5AK4") # airport misclassified, should be in US-AK
etsp <- as.ETSP(data.frame(x = desired_airports$longitude_deg,
y = desired_airports$latitude_deg,
row.names = desired_airports$gps_code))
#distance_matrix <- as.matrix(distm(desired_airports %>% select(longitude_deg, latitude_deg))) / 1000 # convert meters to kilometers
#rownames(distance_matrix) <- desired_airports$gps_code
#colnames(distance_matrix) <- desired_airports$gps_code
methods <- c("nearest_insertion", "cheapest_insertion", "farthest_insertion", "arbitrary_insertion",
"nn", "repetitive_nn", "two_opt")
#distTSP <- as.TSP(distance_matrix)
#solutions <- lapply(methods, function(m) solve_TSP(distTSP, method = m, two_opt = T, rep = iterations))
solutions <- lapply(methods, function(m) solve_TSP(etsp, method = m, two_opt = T, rep = iterations))
stopImplicitCluster()
tour_lengths <- sapply(solutions, tour_length)
best_solution <- solutions[[which(tour_lengths == min(tour_lengths))]]
print(best_solution)
best_airport_route <- labels(best_solution)
print(best_airport_route)
plot(etsp, best_solution, tour_col = "red")
jkjk!
I wish you had a python version I could tinker with
It takes special clearance to get into three of the MD airports. There's one Virginia airport that you can't fly in yourself, but the stamp is there if you drive in (or fly in commercial).
Well, it's a victim of a lot of things. The FRZ didn't help.Hyde Field (W32) has closed, a victim of the FRZ.
Years ago I hit all the airports in Delaware in one trip. Wasn't even a long one!
Sadly, they didn't have a passport program though.
Why? Never heard of a hotel, or airplane camping?
If you're retired, or took a month off, why do you have to return home after every couple airports?
Well, it's a victim of a lot of things. The FRZ didn't help.
In the '90s, I heard that there was a guy who embarked on a project to fly 40 instrument approaches on his 40th birthday. I bet he was real tired when he got done with that!
I was based at VKX for years prior to 9/11. W32 was pretty decrepit then. They had to mow the (paved) runway to keep the weeds at bay. Not much in the way of services. The only thing that kept it alive toward the end was Stan Fetter who operated is traffic reporting business out of there.I used to fly out of there for helicopter training. It was a nice airport. I hear, later it was worse than Laurel.
What, all 5 of them????
What, all 5 of them????
10 public use airports in reality. Even Rhode Island has 7.
N06 - Laurel
IGL - New Castle
GED - Delaware Coastal
EVY - Summit
D74 - Chorman
38N - Smyrna
33N - Delaware Airpark
15N - Jenkins
0N6 - Albanna Aviation
0N4 - Chandelle
The smallest - Chandelle is just 2500 x 28'...I try to avoid runways narrower than my wingspan.