So I was trying to break your code, and I succeeded in doing so!!! After the districts have been found, I then add airports to Chicago and Yakima. After that, I send in Chicago and Disneyland for the shortest distance (by air), and with that, I get the expected result. But after doing so, I tried to send Chicago and Disneyland in for the shortest path, and it throws a seg-fault. I have tried doing the shortest path first and then the shortest distance, but that works out fine until you try to use the shortest path again. I think somewhere in your shortest distance function you're setting some memory funky. I'll try to figure it out.
So I was trying to break your code, and I succeeded in doing so!!! After the districts have been found, I then add airports to Chicago and Yakima. After that, I send in Chicago and Disneyland for the shortest distance (by air), and with that, I get the expected result. But after doing so, I tried to send Chicago and Disneyland in for the shortest path, and it throws a seg-fault. I have tried doing the shortest path first and then the shortest distance, but that works out fine until you try to use the shortest path again. I think somewhere in your shortest distance function you're setting some memory funky. I'll try to figure it out.