• Covered Bridge 54

    First Attempt at a Solution

    And yes, a capital S solution. I need to make the triangular matrix that I talked about last time. This was kind of fun. I’m not a big python user so I took this opportunity to turn out some code I would reject if it crossed my desk at work. But, it’s only a blog and it runs! You can see triangle.py at GitHub. This is heavily based on the Olsen code but there are a few things to note. The first is that the all_waypoints variable is an array of lat/long and human readable names. This way I don’t have to see 42.777500, -72.423222 but instead I see Ashuelot…

  • Covered Bridge 54

    A Genetic Diversion

    In the previous blog I mentioned that I had settled on some open source python, python-mip, to generate my route. It had code like this: distances in an upper triangular matrix dists = [[83, 81, 113, 52, 42, 73, 44, 23, 91, 105, 90, 124, 57], This is an array of data that represents the distance between all the destinations. I needed to make the same list but for my bridges. In Computing the optimal road trip across the U.S, Randal S. Olson has given us code to do that. So I installed the various python packages, got my google maps API Key, and ran the program. It failed. The…

  • Covered Bridge 54

    Let’s Find Some Code

    There is a lot of code out there for solving a Traveling Salesperson Problem, aka TSP. It is of great interest to computer scientists all over the world. I was looking for something that satisfied several constraints: It must be free. Both from a cost standpoint but also from an Open Source standpoint. Doillar free because I’m cheap. :- ) But I also want this to be generally available, because, well, why not? I wanted it to be in a language that I was familiar with but also provided a learning opportunity. Python was my first choice. C and C++ solutions weren’t as interesting to me, just like specialized languages…