State Fair Trip Planning
Some time ago I saw this blog post where Randal S. Olson used a genetic algorithm to compute an optimized path to visit various landmarks across the United States. I have used genetic algorithms professionally for a few things, and I found this application very fun and clever. As part of the blog post, Mr. Olson linked to the Jupyter notebook he used to calculate the optimized road trip. I am a heavy user of Python and the Jupyter notebook, so this intrigued me.
I got the idea to try to apply this kind thinking to the challenge to visiting the various state fairs that typically happen in the mid- to late-summer across the US. In fact, I got the idea to do this before the summer started. Indeed, some of the fairs analyzed below have already ended. But I have a good excuse! My second child was born very recently which has decreased my free time and increased the rate of brain cell death due to lack of sleep. These methods can be applied to future years by simply modifying the start/end dates where all the fairs are listed (in the notebook). Below are the results of my investigations.
The code behind these results can be found here.
Rules
- We only attend fairs in whole-day chunks. In reality, it's possible to arrive in town and attend the fair on the same day. But to keep this analysis simpler, we'll assume that travel days and fair attendance days are separate.
- We drive 12 hours a day. This is obviously something that comes down to personal preference, but I feel that 12 hours is fairly doable if you have more than one driver. Besides, who wants to attend all these fairs by themselves? What this rule means is that if it takes 12 hours and one second to get from point A to point B, the algorithm will count it as a two-day drive. This is obviously not realistic, but it keeps things simple.
When Do Fairs Happen?
Below is a Gantt chart that shows when the various fairs happen. The state name is on the y-axis, and time is on the x-axis. Except for Florida and Nevada, all the fairs happen in a fairly congested time frame between July and November.
Quick note: As can be seen above, the Florida and Nevada state fairs take (took) place far earlier in the year than all the other fairs. Attending them doesn't conflict with any other fair, so I leave them out of my analyses until the end, or I just don't include them.
How to Spend the Most Days at a State Fair
I'm first going to answer question of how to spend the most days at a state fair in 2016. This is the way to eat the most fried things, ride the most rides, and see the most hog races in one summer. The winning strategy here is to get to a state fair and not leave it until you have to (e.g. it ends, or it's advantageous to leave for another fair), and also spend the least amount of time on the road between fairs.
For this analysis, we will not use a genetic algorithm, but rather a directional graph (digraph). This kind of graph is a network of nodes and edges, where the edges link nodes in an allowed direction of travel. In this case, the nodes will be fair attendance days, and the edges will be transitions. Some of the transitions will simply return to the same fair for consecutive attendance days, and other transitions will be travel to a new fair that cover one or more actual days.
After a bunch of math and stuff (see the notebook!) we end up with 128 days that we can attend a fair. The diagram below describes the strategy of how to do this. Here's how to follow the diagram:
- Because they are temporally isolated, Florida and Nevada are to be attended first. We attend each fair for their full duration.
- Next we go to California. We see that there is an edge that goes back to California, and one that goes to Ohio. What this means is that we should stay in California as long as we can or want to, but we should travel directly to Ohio in time for that fair to be open.
- Likewise for Ohio and Indiana, we should stay at those fairs as long as we can/want to, and then travel to the next fair while it is still running.
- For Kentucky, after we have spent enough days there, we have an option of going to Minnesota or Nebraska. Whichever way we go here determines what fairs we can attend later on. For example, if we go to Nebraska, we can't go to New Mexico.
- Follow the rest of the the tree until we end up in Louisiana.

Most Days on the Road
What if you really like driving, but only if you have a destination? Are you some kind of weirdo? Let's see how we can attend state fairs all summer, but spend most of our time driving.
Doing some analysis similar to above, we come up with a method that puts us at state fairs for only 43 days. Note that I'm not including Florida nor Nevada in this count. This method has added 69 extra days of driving!
The strategy diagram below shows how to maximize driving time. It is quite a bit more complicated than the one above. It shows (as might be expected) that the optimal strategy here is to travel between distant fairs as much as possible, even going back and forth between fairs that are open at the same time. If you can travel to another fair far away, do it! For example, near the top there are links between Delaware and North Dakota going both ways. This means that to maximize traveling time, we should go to the Delaware fair, then North Dakota, and then return to Delaware again. After that we may travel back to North Dakota (if it's still open), or head over to Montana or Maine. Inspecting the diagram we'll notice some fair pairs that are very distantly separated (OR<->AK, WA<->TN), which again, makes sense if we are trying to maximize driving time. Also notice that out of the many possible paths, the WY->RI->AK segment is always the best strategy, which is hardly surprising, considering how long of a trip just those two segments are.
Whether or not this kind of strategy is a good idea is a very good question. But here it is. I dare anyone to try it!

Most Unique Fairs in One Summer (with the Lowest Driving Time)
This is the question of how to attend the most number of unique fairs in a single summer. What if we want to sample the character of as many fairs as possible? Which state fair has the best fried food? How might we go about that?
The work by Mr. Olson that inspired me to play around with state fairs used a genetic algorithm to determine a fairly efficient way to visit landmarks across the US. After much thought, I decided that a genetic algorithm would not work (easily) for this question. The reason is that the algorithm does various mutations, substitutions, and combinations that would be difficult to implement when time-ordered events limit choices.
For example, let's say we have a short segment in our path:
CA->DE->OH
and the genetic algorithm randomly decides to modify the Delaware step to a new fair. It can't just pick any fair because the new fair has to be open around the time the California fair. The new fair also has to be located such that we can travel to Ohio afterwards. Chances are that most new fair modifications wouldn't work at all.
Maybe the algorithm could replace the Delaware fair with a fair that works for California, but not Ohio. Then randomly picks the next fair (or fairs) replacing Ohio (and ones after that), fixing the chain until there's no more conflict. To me, that is not much different from just brute-forcing the problem because this would effectively destroy any genomes in the individual, and it would likely reduce its fitness.
This problem is probably as hard as the Traveling Salesman Problem. There are some differences between our problem here and the TSP, but my gut tells me that the two problems are similarly difficult:
- We do not need to visit all the possible states. For example, it's reasonable to expect that visiting Alaska will be very unlikely in any route that optimizes the number of unique fairs visited due to its prohibitive travel time.
- It's okay to visit a state fair more than once, most likely on consecutive days, but there's no rule that prevents us from coming back later if there are no other fairs we haven't already visited. This is a good thing, it means more fried food!
- Fairs are strictly ordered, which limits our available choices at any given time. It also requires us to visit a fair at a certain time which might limit some other options we might have pursued further down the line.
As daunting as this all sounds, a partially-random brute force method is easy to implement. Running it for five minutes gives us this recommended schedule below (in "State + Date" format) that results in visiting 38 state fairs (or 40 if we throw in Florida and Nevada). There's no guarantee that 40 states is the most that we can travel to in one calendar year, only a comprehensive search can prove that (which is a very, very expensive problem to solve). However, considering the size of our nation, and that there are two fairs that are impractical to attend (Alaska and Hawaii), and one that doesn't exist (Pennsylvania), 40/47 isn't bad at all.
'CA+2016-07-16', 'DE+2016-07-21', 'ND+2016-07-25', 'OH+2016-07-28', 'MT+2016-08-01', 'WI+2016-08-04', 'ME+2016-08-07', 'NJ+2016-08-09', 'MO+2016-08-12', 'IL+2016-08-14', 'WY+2016-08-17', 'IA+2016-08-19', 'IN+2016-08-21', 'KY+2016-08-23', 'NY+2016-08-25', 'MN+2016-08-28', 'NE+2016-08-30', 'CO+2016-09-01', 'OR+2016-09-04', 'WA+2016-09-06', 'ID+2016-09-08', 'UT+2016-09-10', 'NM+2016-09-12', 'TN+2016-09-15', 'KS+2016-09-17', 'MA+2016-09-20', 'CT+2016-09-22', 'OK+2016-09-25', 'VA+2016-09-28', 'GA+2016-09-30', 'TX+2016-10-02', 'GA+2016-10-04', 'MS+2016-10-06', 'AZ+2016-10-09', 'NC+2016-10-13', 'SC+2016-10-15', 'AR+2016-10-17', 'AZ+2016-10-20', 'AZ+2016-10-21', 'AZ+2016-10-22', 'AZ+2016-10-23', 'AZ+2016-10-24', 'LA+2016-10-27', 'AL+2016-10-29 '
Anything Else?
Please leave a comment or send me a note (my email is easy to find) with any ideas.
Chicago in January
I just returned home from a trip to Chicago for the 2012 yt workshop. I didn't organize the meeting, but I did give a few talks. I think overall it was a very productive and useful workshop, and I met quite a few people who I had previously only corresponded with over the internet.
I found the Chicago "L" pretty useful, although it's not quite as nice as the New York Subway. Being overground most of the time, it's possible to view the neighborhoods it goes through (which is one benefit it has over a subway). Chicago, and especially South Chicago, is in a state of decay that I rarely see in western cities. Of course it's been going on for decades: the city has lost nearly 1 million people since 1950, but it's interesting (and sad) to see blocks where only a few buildings are standing, where dozens used to be in a vibrant neighborhood.
Our Grand Amtrak Journey
For our trip to the Bay Area for Thanksgiving, we took the Amtrak California Zephyr from Denver to Emeryville. The train leaves Denver at 8am, and arrives in Emeryville at 4:30pm the next day. It's clearly not the fastest way to travel (nor is it the cheapest with a sleeper cabin, which we purchased), but it is far more scenic than the alternatives.
Real utensils! Lovely and unique railroad views!
The train consisted of (in order) two engines, a baggage car, three coach cars, an observation/lounge/snack bar car, a dining car, and two sleeper cars. Our cabin was in the last car. Included in the price of a sleeper cabin are all meals in the dining car. The food is better than airline food (well, that is, was, when meals were actually a thing that airlines did) because it's actually prepared in the kitchen below the dining room and not simply microwaved. The dining car has tables that seat four, and if your party is less than four people, you will be seated with strangers. We met some interesting (using the full breadth of that word) people while eating our meals.
Our "roomette" was cozy. There are four shared toilets in a sleeper car, and one shared shower. The toilets are pretty much like airplane lavatories, but the shower was surprisingly spacious, fairly clean, and the water pressure and temperature was good.
The Zephyr is considerably quieter than a passenger jet, but because it runs on rails that are used primarily by freight trains, the ride isn't always smooth. It was not such an issue when the train was moving at 30 or 40 MPH through the mountains, but when it was going 80 MPH across Nevada in the middle of the night, it made sleeping difficult.
In summary, we're glad that we took the train. It's a unique experience that goes through the most beautiful parts of America that can't be seen from the interstates. We had the time to do it, and it was worthwhile. That being said, we're not eager to do it again anytime soon. We met many people on the train who seemed to love it - they were even on a first-name basis with the train staff. But the train isn't quite for us. Still, we recommend that other people consider trying it at least once. There are many things worth doing at least once, and this is one of them.
Mini-Vacation – Monterey Bay Aquarium
Yesterday, Melissa and I visited the Monterey Bay Aquarium. We were met there by my brother Adam and his lady friend Shinji, who not coincidentally decided to also see the aquarium on the same day. The aquarium has expanded since my last visit. There is now a northern wing that has fresh water otters, an "outer bay" tank and a seahorse exhibit (that was under construction, sadly). More than the last time I was there (or maybe I was too young to pay attention to things not cute), the aquarium really pushes conservation and ethical seafood consumption. They have a [set of cards](https://www.seafoodwatch.org) you can carry to help guide seafood and sushi purchases in stores and restaurants.
Mini-Vacation – Hearst Castle
The Hearst Castle is ridiculous. The architecture and the history of the people who visited it are quite a spectacle. And of course I think it would have been grand fun to have visited it when William Randolph Hearst was alive and the place was hip and hopping. I was wondering with Melissa over dinner if I became silly rich could I invite movie stars and political leaders over to my remote ranch? Probably not. We did both agree that if we were to build on that site we would have had more of the buildings and common areas facing the grand view. As it is, many of the rooms, like the dining room, have no view.
Before we went to the castle we looked at some tide pools. Melissa even found a hermit crab wandering in between the rocks.
Tomorrow we will see the Monterey Bay Aquarium.
Mini-Vacation – Santa Barbara
Melissa and I are taking the slow route up to the Bay Area for the holidays. Tonight we're staying in Santa Barbara, and we'll visit the Hearst Castle tomorrow. For dinner we ate at a decent Mexican restaurant on State Street. Afterwards we walked down State Street looking at all the shops and restaurants. It's clear that the economy has started to hit Main, err... State Street America. Despite the Christmas decorations, and the huge tree in a left-turn lane, there are quite a few empty stores and others going out of business. I guess now is the time to start a new business cheaply in Santa Barbara - as long as you can weather the current economic storm.
More tomorrow!
Hawaiian GT-40
Parked in front of my building this morning is a Hawaiian Ford GT, which retails for the suggested price of $139,995. Someone has to be serious about their car to bring it all the way from Hawaii. They even have driving gloves that match the seat belts.
This is the first time I've seen one parked, I never realized how deep the vents behind the radiator are in the hood.
Like all expensive cars, the motor has its own window.
Anza Borrego Desert State Park
I've posted some photos from Anza Borrego Desert State Park. Melissa and I drove out to see the wildflowers and go for a hike. As you can see above, both of my hiking boots lost their soles. I had them re-soled a few months ago and hadn't used them since. They started falling apart only a little bit into the hike and we shorted the walk when it became clear the damage was progressing. For the last third I had to high-step it to keep the front of the soles from catching on the ground. One sole fell apart completely meters from the car. Happily, I didn't drive in my hiking boots so I had another pair to wear the rest of the day.
We also sorta kinda saw a Big Horned Sheep on the hillside. In the photo the sheep's body is facing you with its head turned to the left (your left). It was hard to see it in the shadow of the rock; I didn't see it until Melissa pointed it out at home. I took the photo on blind faith that everyone wasn't lying to me.
Las Vegas
This last weekend I drove to Las Vegas for a one night stay to celebrate Chris Schroeder's upcoming wedding. Las Vegas wouldn't have been my first choice for such an occasion, but I'm not getting married.
A nice rock formation
The drive itself is actually much more interesting than, say, the drive on I-5 in the central valley. Unlike that drive, there's lots of topography to see. The Mojave is surrounded by fairly high mountains and to get to Las Vegas you have to drive over them. The weather provided a point of conversation too. The desert southwest was in a heat wave over the weekend and we saw a high of 116 in Baker, CA. I'm sure my mother was happy to not be on this trip.
I went with three other people besides Chris: Paul and Shane, both physicists, and Francisco, a Portuguese bioengineering graduate student. He's Portuguese by nationality, not his studies. We stayed over Saturday night in Las Vegas at Binion's hotel on the old strip. The old strip of Las Vegas was the strip until about the 1950s. Since then, most of the development money has gone to the new strip which is farther South, outside of the Las Vegas city limits. Because the new strip is where most people go, the old strip tries really hard to attract tourist and gambling money.
One of the things the old strip has done to attract visitors is to convert the main street into the Fremont Street Experience. The road was turned into a pedestrian mall and a 5 block long canopy was erected. The inside of the canopy is covered in millions of LEDs which plays video throughout the night. It's all very excessive. The videos celebrate what's great about the USA: NASCAR, dancing ladies, loud classic rock and country music, and cool computer graphics. They also have free street attractions, like four motorcycles in a sphere.
There's other evidence of the USA in its finest form in Las Vegas. I was aghast at the number of people with small children with them at 11:30pm.
Also the number of amazingly fat people. The convergence of so many temptations is unique too. My submission to temptation of gambling cost me $10. I did not submit to the other temptations which would have further emptied my wallet.
Overall I found Las Vegas more interesting than entertaining. I have a strong enough mathematical background and not enough greed to find gambling worthwhile. I find nudie bars boring. The various shows in Las Vegas are out of my price range (most start at around $70). I suppose if I was a heavy drinker I could find all of the above compelling (or at least a good idea while intoxicated), but, alas, I'm not. It should be a while before I visit Las Vegas again.
A Drive to Newport Beach
919 frames, 1h15m real time, ~5s between frames, my apartment to Newport Beach, I-5 to I-405 to CA-55, June 30, 2007
Here is a neat time lapse of the drive from my apartment to Melissa's maternal grandmother's house in Newport Beach. I set my camera up on the tripod in the rear section of my Volvo station wagon. I held the tripod down with a few bungee cords, but you'll notice that the camera moves slightly through the duration of the movie. I'll have to devise some sort of better securing mechanism for future efforts. In particular, I'd like to figure out a solid way of having the camera point forward on the dashboard. I cropped the images to remove the majority of the inside of the car as it isn't very exciting.
Gohan, South Korea
According to the comment on my last post, my brother is not actually going to teach in Jeongseon. He's in Gohan, a few valleys over from Jeongseon. Interestingly, it's the home to the only casino in South Korea that South Koreans can gamble in. It's also going to open a ski resort in December which has made him happy, no doubt.
Hopefully he'll post something about the hamlet soon.
Jeongseon, South Korea
My brother is in Korea to teach english for a year. A few days ago he was told exactly where he'll be teaching, Jeongseon, Kangwon-do province, South Korea. Sensing a challenge, I went ahead and tracked down this mountain town.
The image on the left is a Google Earth image of the area around Jeongseon. It's a mountainous area -- the town appears to be jammed in between 1000 meter peaks at a 180 degree bend in the river (what river?). It also appears to be small -- it's smaller than 2 miles from end to end. If you'd like to find Jeongseon, go to 37° 22'36.52" N, 128° 39'54.46" E.
Palomar Mountain
A week ago Tyler Ofstad and I rode up Palomar Mountain, twice. Starting at the corner of Valley Center Road and CA 76, at the mexican restaurant there, we climbed up 76 to South Grade Road. At the top, we descended down East Grade Road, and rode 76 a bit south for another climb on Mesa Grande. At the top of that we turned around and went back the way we came. The total climbing came out to over 2,500 meters, or about 8,300 feet. The only time I have climbed more than this was at the Everest Challenge, which has 15,465 and 13,570 feet of climbing in its two days.
Palomar Mountain is a popular destination for Southern California cyclists, as well as for motorcyclists, who roar up and down the mountain on any dry day. The constant buzzing of motorcycles gets a bit old over the course of South Grade Road. Thankfully, motorcyclists don't drive so much on East Grade Road, due to its near lack of hairpin turns. Mesa Grande is a short and steep; it climbs about 250 meters in about 2 kilometers.
If you look closely at the elevation versus distance graph below, you'll see sharp, jagged edges on the descents. This is due to trees blocking the signal to my GPS, degrading its 3D resolution. 2D degrades much less in trees, so the GPS measures my distance, but doesn't update my altitude. I'm moving so fast decending that by the time the 3D resolution comes back, I've dropped a fair amount.
North Korea
I have been reading all kinds of travelogues about North Korea recently. I find it an incredibly interesting place, it's kind of frozen in time since the Korean War. It's very Orwellian, the way China and the USSR used to be. I find the utter ignorance to the outside world of the average North Korean fascinating. And Kim Jung Il is always amusing (10cm lift shoes!), except when he's allowing his people to starve by the hundreds of thousands (perhaps millions).
See what the CIA thinks about North Korea.



















