TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ryanair, Hamiltonian Cycles, and using graph theory to find cheap flights

466 pointsby jonlucaover 6 years ago

19 comments

smartbitover 6 years ago
Hacking PNR <a href="https:&#x2F;&#x2F;media.ccc.de&#x2F;v&#x2F;33c3-7964-where_in_the_world_is_carmen_sandiego" rel="nofollow">https:&#x2F;&#x2F;media.ccc.de&#x2F;v&#x2F;33c3-7964-where_in_the_world_is_carme...</a> <i>at time of the talk</i> (2 years ago) used&#x2F;discussed these sites:<p><a href="https:&#x2F;&#x2F;matrix.itasoftware.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;matrix.itasoftware.com&#x2F;</a> to get detailed fare rules &amp; restrictions<p><a href="https:&#x2F;&#x2F;www.expertflyer.com" rel="nofollow">https:&#x2F;&#x2F;www.expertflyer.com</a> &amp; <a href="https:&#x2F;&#x2F;itunes.apple.com&#x2F;us&#x2F;app&#x2F;seat-alerts&#x2F;id533533342" rel="nofollow">https:&#x2F;&#x2F;itunes.apple.com&#x2F;us&#x2F;app&#x2F;seat-alerts&#x2F;id533533342</a><p><a href="https:&#x2F;&#x2F;www.checkmytrip.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.checkmytrip.com&#x2F;</a> allows entering name &amp; booking-reference and gives all detail<p><a href="https:&#x2F;&#x2F;www.viewtrip.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.viewtrip.com&#x2F;</a><p><a href="https:&#x2F;&#x2F;tripcase.com" rel="nofollow">https:&#x2F;&#x2F;tripcase.com</a> will use name + booking-reference to get detailed PNR information including the first name<p><a href="https:&#x2F;&#x2F;www.fly.kiev.ua" rel="nofollow">https:&#x2F;&#x2F;www.fly.kiev.ua</a> can make a flight reservation without a payment, still gives an 6char booking-reference
评论 #18537993 未加载
评论 #18533279 未加载
jd20over 6 years ago
Looks cool! The problem of enumerating the best routes between two given airports is indeed an interesting problem. My favorite discussion of the problem is from Carl de Marcken: <a href="http:&#x2F;&#x2F;www.ai.mit.edu&#x2F;courses&#x2F;6.034f&#x2F;psets&#x2F;ps1&#x2F;airtravel.pdf" rel="nofollow">http:&#x2F;&#x2F;www.ai.mit.edu&#x2F;courses&#x2F;6.034f&#x2F;psets&#x2F;ps1&#x2F;airtravel.pdf</a><p>I&#x27;ve been involved in solving a similar problem, on the award flight search side. There are about 12,000 direct commercial routes offering award redemption, and the airline websites have different limitations: some only let you search one-way or only round-trip, or only one cabin at a time, or only give hints about available quantities. So you have to formulate the minimal set of queries that will give you complete information. And then given an origin and destination, figure out the valid routings, like you&#x27;ve discovered.<p>The other really interesting challenge with many of the airline websites are the extreme measures they go to, to block you from crawling their data. My favorite is British Airways, which runs 800 different tests to fingerprint your browser, from generating audio files to drawing to an off-screen canvas, all inside a custom VM with encrypted byte code. (Similar to how I&#x27;ve seen Google obfuscate the ReCaptcha code base.) Surprising to hear that Ryanair makes it so easy to access prices in comparison!
评论 #18531585 未加载
评论 #18533369 未加载
crikliover 6 years ago
Off-topic but related: <a href="https:&#x2F;&#x2F;scottscheapflights.com" rel="nofollow">https:&#x2F;&#x2F;scottscheapflights.com</a> is _amazing_. The Premium sub is worth every penny...my wife and I will be doing a ton more overseas travel in 2019 purely because of the deals this site finds.
评论 #18532970 未加载
评论 #18530871 未加载
评论 #18531831 未加载
评论 #18530909 未加载
SmellyGeekBoyover 6 years ago
If nothing else, at least I learned from the comments here that most of HN seem to be working on their own competing flight search engines ;)
评论 #18533359 未加载
abhisuri97over 6 years ago
As a CS student, I agree it is really refreshing to see basic graph algorithms to be used in a practical, non academic&#x2F;industry context. I never really see these basic algorithms used in small side projects, so thank you for this!
whazorover 6 years ago
We (me and friend) are working on the same problem, however we are stuck at the next step. Namely the user interface: how do you let the user search through all the possibilities.<p>We created some data structures that allow almost instant searching of such routes and we have scrapers running regularly on Ryanair, easyJet, wizzair, and Transavia. You can query the algorithm here: <a href="https:&#x2F;&#x2F;algo.tripchemy.com&#x2F;routes&#x2F;TSF?year=2019&amp;month=02&amp;day=10&amp;length=20" rel="nofollow">https:&#x2F;&#x2F;algo.tripchemy.com&#x2F;routes&#x2F;TSF?year=2019&amp;month=02&amp;day...</a><p>Where you want to have a trip of 20 days (4 lovatons, 5 flights) from 10 Feb. Starting and returning to TSF. We also added some scoring for niceness of airports.
评论 #18532212 未加载
评论 #18532783 未加载
评论 #18532137 未加载
评论 #18532336 未加载
warp_factorover 6 years ago
back when I was a student, I would sometimes spend hours on Ryanair&#x27;s website to find that type of deals.<p>My base was Paris and I wanted to go to Stockholm for example. The direct Ryanair flight from Paris to Stockholm was expensive (Let&#x27;s say 150 euros). I would manage to find two cheap flights that go for example from Paris to Rome and another one from Rome to Stockholm, both of those for 10 Euros each. The key is to use the big Ryanair hubs as gateway (Milan and Brussels would work really well back in the days)<p>I would basically lose my whole day traveling to save 80 euros. Sometimes it backfires though, and when it backfires you are on your own. Once my first flight got super delayed, and I got stuck in Milan for the night. I managed to have Ryanair rebook my second flight for the day.<p>I think Ryanair wants to be able to propose high prices for direct flights and prevent people from finding those cheaper indirect flights. That&#x27;s why they don&#x27;t make it easy to find them.
评论 #18531704 未加载
mtrovoover 6 years ago
I use <a href="https:&#x2F;&#x2F;airwander.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;airwander.com&#x2F;</a> when flying overseas, I don&#x27;t know how well it works for low cost airlines though.<p>It&#x27;s a flight search engine that let you filter what connections there are between the cities you want to travel and help you book a single flight that is going to stay there as a stopover. Sometimes it finds some weird flights that doesn&#x27;t make any sense if you&#x27;re just trying to reach your destination but if you&#x27;re just traveling it&#x27;s quite nice.<p>Last time I used it I found a overseas flight that stopped in Lisbon but on the way back made a connection in Bologna that was +200 cheaper then the normal flight.
评论 #18532090 未加载
评论 #18532525 未加载
评论 #18532393 未加载
shoyerover 6 years ago
This article misses the most obvious way to visualize this graph: put it on a map!
评论 #18532338 未加载
catchmeifyoucanover 6 years ago
Great work, this is really cool!<p>For multi city flights, I&#x27;ve found Google flights does things really well from a UX standpoint, and I believe they support Ryanair.
评论 #18531732 未加载
评论 #18530862 未加载
kasparsklavinsover 6 years ago
Why is there no interface that allows searching for flights without specifying <i>exact</i> dates? All I want to do is fly from A to B to A. Maybe stay a week, maybe two. I&#x27;m flexible - it doesnt have to be exactly N days starting on the M&#x27;th.<p>Even services that &quot;allegedly&quot; advertise they have that, still require manually clicking every day combination.<p>I&#x27;d fly more often <i>if it was easy</i>. The few times I tried, it would be just faster to drive than go through all possible 900+ day combinations.
评论 #18533702 未加载
评论 #18533463 未加载
评论 #18533411 未加载
评论 #18533849 未加载
评论 #18567944 未加载
评论 #18533630 未加载
评论 #18535340 未加载
评论 #18533972 未加载
评论 #18533584 未加载
thomasahleover 6 years ago
Finding a cycle of a given length can actually be done in time `O(e^k n^2.3)` where `k` is the length of the cycle, using the cool technique of color coding.<p>Basically, to find a cycle of length 6, you repeatedly color every node in one of 6 colors at random. Then you look for a cycle with all different colored nodes, which can be done efficiently using dynamic programming.<p>You succeed in finding a particular 6 cycle exactly if each node in it has gotten a different color, but the chance of this is not bad. In the case of the OP it&#x27;s even better, since there are probably many such cycles to find.
frakkingcylonsover 6 years ago
Somewhat off-topic and shameless plug, I&#x27;m working on a meta flight-search engine that finds the cheapest flights from multiple origins to the same destination (i.e. me and some friends who live in another city want to fly to Hong Kong with no particular date in mind, just want the cheapest flights and with overlapping departure&#x2F;return dates). Does anyone else have a similar need or know of anything that can do this?
blackdogieover 6 years ago
A nice handy tool. It would be great if the airline added this themselves for finding route. Great work
voolover 6 years ago
@jonluca<p>If you are looking to take this further, you can find some more info on Ryanair API endpoints here:<p><a href="https:&#x2F;&#x2F;gist.github.com&#x2F;vool&#x2F;bbd64eeee313d27a82ab" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;vool&#x2F;bbd64eeee313d27a82ab</a>
rexarexover 6 years ago
That’s awesome
jaycolsonover 6 years ago
ryan air weekend flight search ... pretty handy<p><a href="https:&#x2F;&#x2F;github.com&#x2F;cloudsquall&#x2F;flightsearch" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cloudsquall&#x2F;flightsearch</a>
zabakiover 6 years ago
Now i just gotta figure out all the airport abbreviations D:
maa5444over 6 years ago
it&#x27;s cheap maybe it&#x27;s not a fake the fact they spray the sky