09
Weekend flights along the pareto frontier
2026-02-09 · 586 words
I was curious to see whether I could find cheap cross-country flights for this upcoming long weekend. Spoiler: guess. The problem with sites like Google Flights (gflights) is that the interface only offers prices at the scheduling granularity of a day. the difference between a red-eye and a flight the night before can be pretty huge. For short trips, this granularity makes it hard to find flights that allow you to spend as much time somewhere as possible, at the lowest fare possible, given the constraints of your schedule. Which… is probably a good thing tbh.
It would be nice if you could say, “Lucky me, I’m free to fly out after 2pm on Friday and I need to be back by Tuesday at 10pm!” and see the whole pareto frontier of flights you could take. The good news is that it is now much cheaper to prototype a little tool like this! Writing code is cheaper than booking flights. A boy can dream. So I whipped up a little utility to mess around with some dates:
Github: slightknack/weekend
Find good deals on flights for weekend trips. Hacky flask + htmx app that you can run locally.
I’m not going to focus on the code, because it was generated. As far as the value of things goes, this tool has high personal utility but low personal value… What I like are the graphs that follow.
This tool lets you pick your departure window (date + time of day) and return window (e.g. get back home before 10pm). It uses gflights to find all valid round trips within whatever arrival/departure window you give it. It then looks at all the possible round trips, and graphs price vs. “how much time do you really get to spend at your destination?”:

The colors here represent the number of stops (green is non-stop only, for example). The y-axis is cost (top is cheaper) and the x-axis is time at destination (right is more time). The best bang-for-your-buck flights are those along the pareto frontier (the dotted line). Ideally a flight that is on a convex portion of the frontier, which is to say, sticking out.
We also take all the flights on the pareto frontier, and generate a plot that shows the relative timelines of each flight option. This makes it clear whether an “optimal” flight leaves earlier or later relative to another optimal flight:

The first iteration of this tool saved me a lot of time finding the best flights! The time it took to polish everything and write a blog post, however, took much longer… at the very least, I hope this was at least a little interesting. Maybe by the time generative UI comes around, this tool will be in the training distribution, and people will ask for these types of trinkets on the fly. Like cheap weekend flights, one can dream.
If you want a good fun interactive explanation of Pareto frontiers, I enjoyed reading:
Daily reading: Mario Meets Pareto
Padded so you can keep scrolling. I know. I love you. How about we take you back up to the top of this page?