We've all been there. In the morning, you check the price of an airline ticket for a trip you're pondering, and get one number. By lunch it's something totally different. And you find another price when you look again next Tuesday.

Are airlines just trying to torture us? Is there method behind the madness? And what, if anything, can you do to keep your sanity intact and your wallet as full as possible? CNN's Richard Quest recently went looking for answers for an entertaining and helpful CNN segment on the issue. What did he find out?

Airline pricing is as complicated as rocket science.

"It's rocket science," Andy Boyd, former chief scientist at a company that makes "revenue management systems" for airlines tells Quest. Or, in other words, Boyd helped design the algorithm that drives you nuts when you're shopping for flights. Why did he and his colleagues make it so unbelievably complicated -- and irritating?

It doesn't take a Nobel-prize in economics to guess the answer -- to make the airlines more money, of course.

"Revenue management is really fundamentally about looking at what the market's willing to pay," Boyd continues. Using decades of data on demand and customer behavior, these algorithms are constantly re-jigging prices to try to squeeze every possible dollar (or euro, or yen) out of travelers.

"The computers do the work by themselves: estimate what passengers you expect to show up, use that in an algorithmic mix to figure out how they're going to set the different prices," explains Boyd. Quest helpfully (and humorously) gets down on the floor with a row of literal "price buckets" and tennis balls representing customers to illustrate how airlines open and close various classes of ticket prices depending on minute-by-minute demand.

For the passenger, the end result is a different price at breakfast and at lunchtime and a whole lot of annoyance. "I get infuriated when it happens to me too," concedes Boyd. But it's good business for the airlines.

How can you beat the algorithm?

Quest goes on to explain new tools from startups like SeatBoost, which allow passengers to bid on upgrades literally minutes before the plane takes off. It sounds like a fun diversion while you're waiting at the gate, but are there any more reliable ways to beat the algorithm and score the best possible deal?

According to a recent myth-busting New York Times article on the subject there are no easy formula for finding a bargain -- forget that old saw about Tuesday and Thursday being the best days to buy, for instance. Nor is there a particular number of days before you fly when you're guaranteed to find the best prices. The pricing algorithms are just too fast-moving for these tricks.

Instead, getting a good deal seems to come down to a few basics, and a fair amount of legwork. First, if you see a good price, jump on it. Don't wait. It won't stick around and you're unlikely to get an even better one a week or a day later.

Second, use one of the many sites like Google Flights and Kayak that allow you to search multiple airlines and flexible dates to compare prices and sort by essential factors like layover times and number of connections. (Clearing cookies between searches might help you find a better deal too.)

"To keep abreast of private sales and low fares (as well as hotel deals), you can search or sign up for alerts on Airfarewatchdog.com," writes Stephanie Rosenbloom. "Because prices are constantly fluctuating, keep checking airline websites and Google Flights to see the latest fares."

"Even after you buy a ticket, you still have a chance to save. If you go to My.yapta.com/airline-refunds, you can sign up to receive free notifications if your ticket price drops," she adds. "If the price drop is greater than the cost of your airline's change fee, you can call the airline and pocket the difference."

Which sounds fairly labor intensive, but apparently it takes a bit of doing to outwit the rocket scientists behind the airlines' revenue management systems.

Published on: Sep 23, 2016