To calculate the price of a ticket, we first need to know a little about how air pricing works.
A ticket is a single, complete contract for one journey. It can contain up to a maximum sixteen flights.
Each flight on the ticket must be paid for ("covered") by exactly one fare. A fare is a price that the airline offers on a city-pair, for example, London-New York, together with a complicated set of rules on how the fare may be used (i.e., the fare rules determine under what conditions that price is valid). Although every flight gets covered by exactly one fare, a single fare could cover multiple flights: For example, a London-New York fare issued by Air France would probably cover London-Paris, and Paris-New York. If you were going as far as Rochester in upstate New York, then the fare would cover London-Paris, Paris-New York, and New York-Rochester, (with the final flight operated by Delta Airlines, but still covered by your Air France fare).
Every carrier publishes a fare tariff, which is just a public list of fares. For example, let us say I want to know what the fare tariff for HKG-SYD [Hong Kong to Sydney] is as sold by QF [Qantas].
This information is distributed to travel agents via a system called the "GDS" (global distribution system).
The validity of the tariff varies by sales city, and may change several times a day; although in practise certain fares tend to stay on the tariff for many years with only small changes to their price. The system is not designed to handle changes to the fare tariff more frequently than about once per hour. If my travel agent is located in London and intends to complete ticketing today, the current tariff on HKGSYD published by QF is
Fare Basis Airline Booking Trip Type Fare Cabin Effective Expiration Min/Max Advanced
Class Date Date Stay Purchase Req
S50HK3 QF S Round-Trip 414.00 (GBP) E 10/05/15 02/02/16 -- / 3M 50
11/02/16 30/06/16
11/08/16 22/01/17
01/02/17 31/03/17
SSHK3 QF S Round-Trip 464.00 (GBP) E 24/03/15 28/01/16 -- / 3M
01/04/15 02/02/16
11/02/16 31/03/16
11/08/16 22/01/17
01/02/17 31/03/17
LSHK6 QF L Round-Trip 531.00 (GBP) E 24/03/15 31/03/16 -- / 6M
01/04/15 31/03/17
MSHK QF M Round-Trip 614.00 (GBP) E 24/03/15 31/03/16 -- / 12M
01/04/15 31/03/17
KSHK QF K Round-Trip 713.00 (GBP) E 24/03/15 31/03/16 -- / 12M
01/04/15 31/03/17
HF1HK QF H Round-Trip 834.00 (GBP) E 24/03/15 31/03/16 -- / 12M
01/04/15 31/03/17
BF1HK QF B Round-Trip 977.00 (GBP) E 24/03/15 31/03/16 -- / 12M
01/04/15 31/03/17
YF1HK QF Y Round-Trip 1194.00 (GBP) E 24/03/15 31/03/16 -- / 12M
01/04/15 31/03/17
WSHK QF W Round-Trip 1252.00 (GBP) E 24/03/15 31/03/16 -- / 12M
01/04/15 31/03/17
YRT QF Y Round-Trip 1676.00 (GBP) E -- / 12M
I50HK1 QF I Round-Trip 1724.00 (GBP) B 21/03/15 31/03/16 -- / 12M 50
I21HK1 QF I Round-Trip 1909.00 (GBP) B 21/03/15 31/03/16 -- / 12M 21
ISHK QF I Round-Trip 2169.00 (GBP) B 21/03/15 31/03/16 -- / 12M
YIF YY Y Round-Trip 2231.00 (GBP) E
D14HK1 QF D Round-Trip 2472.00 (GBP) B 21/03/15 31/03/16 -- / 12M 14
DSHK1 QF D Round-Trip 2803.00 (GBP) B 21/03/15 31/03/16 -- / 12M
CFHK1 QF C Round-Trip 3178.00 (GBP) B 21/03/15 31/03/16 -- / 12M
JFHK1 QF J Round-Trip 3633.00 (GBP) B 21/03/15 31/03/16 -- / 12M
JRT QF J Round-Trip 3740.00 (GBP) B -- / 12M
(I filtered out non-roundtrip fares.)
You can see there is a long price list. Each fare will have a set of rules in how it can be used, such as—
- whether the fare can be used to make one-way journeys, round trips, circle trips, round-the-world journeys, or other types of journeys;
- whether you must stay at the destination city for a minimum or maximum period of time;
- which days of the week and hours of the day travel can occur on;
- whether the fare is only valid at certain times of the year or even only on specific dates;
- whether you are allowed stopovers at connecting cities on the fare;
- whether you must buy the fare in advance of travel, and how far in advance;
- whether ticketing must be completed by a certain date (in a sale fare for example);
- how long you are allowed to hold reservations on flights under this fare before paying for the ticket;
- which flights the fare is valid on, and this may or may not include flights offered by other carriers;
- whether and how many transfers are allowed (in the case of indirect
flights);
- whether the ticket can be changed or refunded later, and if
so what penalties apply under what conditions;
- whether the fare can be combined with other fares and how those combinations can come together (and that could include fares issued by other carriers);
- whether unaccompanied minors are allowed, and if so whether a penalty
applies;
- whether infants, children or seniors are eligible for a discount;
- whether this is a companion fare requiring several people to travel at the same time in the same party;
- who is permitted to issue tickets under the fare (some fares can only be issued by the airline and not by travel agents);
- whether the fare can be "printed" onto another carrier's ticket "paper", and the other carrier is therefore trusted to collect payment (even though we now use electronic ticketing, it is a direct implementation of the old analogue concept of paper tickets);
- whether a ticket with the fare can be "endorsed" onto another carrier offering service on the same route (very rare these days);
- and many other conditions ...
As you can see, there are a lot of restrictions and rules possible! By creating these rules very carefully, the carriers intend to keep the price as high as possible but also sell tickets to as many people as possible. For instance, tickets intended to be sold to tourists at low prices will often have to be purchased a few weeks in advance. A consultant who buys his tickets with 2 hours notice will pay a large price for his indecision. It is the flexibility of these rules that make pricing an air ticket a very difficult problem to solve.
To give you a flavour, I will post a subset of the rules from the cheapest fare here. I cannot post the full rules from the fare because it would make my answer far too long! This is QF HKGSYD S50HK3
Rule Category Rule Text
RULE APPLICATION AND OTHER CONDITIONS NOTE - THE FOLLOWING TEXT IS INFORMATIONAL AND NOT
VALIDATED FOR AUTOPRICING.
50 DAYS ADVANCE PURCHASE SAVER EXCURSION ECONOMY CLASS
FARES
FROM HONG KONG TO AUSTRALIA NEW ZEALAND FIJI NEW
CALEDONIA
APPLICATION
AREA
THESE FARES APPLY
FROM HONG KONG SAR CHINA
TO AUSTRALIA/NEW ZEALAND/FIJI/NEW CALEDONIA/
SOLOMON ISLANDS.
CLASS OF SERVICE
THESE FARES APPLY FOR ECONOMY CLASS SERVICE.
TYPES OF TRANSPORTATION
FARES GOVERNED BY THIS RULE CAN BE USED TO CREATE
ROUND-TRIP/CIRCLE-TRIP/OPEN-JAW/SINGLE OPEN-JAW/
ORIGIN SINGLE OPEN-JAW /TURNAROUND SINGLE
OPEN-JAW/DOUBLE OPEN-JAW JOURNEYS.
CAPACITY LIMITATIONS
THE CARRIER SHALL LIMIT THE NUMBER OF PASSENGERS
CARRIED ON ANY ONE FLIGHT AT FARES GOVERNED BY
THIS RULE AND SUCH FARES WILL NOT NECESSARILY BE
AVAILABLE ON ALL FLIGHTS. THE NUMBER OF SEATS,
WHICH THE CARRIER SHALL MAKE AVAILABLE ON A GIVEN
FLIGHT, WILL BE DETERMINED BY THE CARRIERS BEST
JUDGEMENT.
OTHER CONDITIONS
FARES ONLY APPLY IF PURCHASED BEFORE DEPARTURE
EXCEPT WHEN USED FOR ENROUTE UPGRADE FROM ANOTHER
FARE PROVIDED ALL CONDITIONS OF THESE FARES ARE
MET OR FOR ASSESSING THE REFUND OF A PARTIALLY
TRAVELLED TICKET.
---
THE OPERATING SCHEDULES OF PARTICIPATING CARRIERS
MAY BE SUBJECT TO CHANGE WITHOUT NOTICE. SERVICES
TO SOME DESTINATIONS MAY BE OPERATED ON A SEASONAL
BASIS.
---
THE FARES ARE ROUTE BASED ACCORDING TO SPECIFIED
ROUTE MAPS.
---
THE PAYMENT OF PASSENGER EXPENSES ENROUTE DOES NOT
APPLY.
ELIGIBILITY NO ELIGIBILITY REQUIREMENTS APPLY.
DAY/TIME NO DAY/TIME TRAVEL RESTRICTIONS APPLY.
SEASONALITY PERMITTED 10MAY15 THROUGH 02FEB16 OR 11FEB16 THROUGH
30JUN16 OR 11AUG16 THROUGH 22JAN17 OR 01FEB17 THROUGH
31MAR17 ON THE FIRST INTERNATIONAL SECTOR. SEASON IS
BASED ON DATE OF ORIGIN.
NOTE - TEXT BELOW NOT VALIDATED FOR AUTOPRICING.
FOR OJ JOURNEYS - AS IT IS THE DATE ON THE
OUTBOUND INTERNATIONAL SECTOR THAT DETERMINES THE
SEASONAL PERIOD FOR EACH HALF OF THE JOURNEY THE
RESULT MAY BE THAT DIFFERENT SEASONS APPLY
OUTBOUND AND INBOUND WHEN FARES WITH DIFFERENT
SEASONALITY ARE COMBINED.
FLIGHT APPLICATION THE FARE COMPONENT MUST NOT BE ON
ONE OR MORE OF THE FOLLOWING
QF FLIGHTS 200 THROUGH 299
QF FLIGHTS 315 THROUGH 318
QF FLIGHTS 5000 THROUGH 5400
QF FLIGHTS 5402 THROUGH 5999
QF FLIGHTS 8000 THROUGH 8765
QF FLIGHTS 8767 THROUGH 8999.
AND
THE FARE COMPONENT MUST BE ON
ONE OR MORE OF THE FOLLOWING
ANY QF FLIGHT
ANY CX FLIGHT OPERATED BY CX
ANY IE FLIGHT OPERATED BY IE
ANY 3K FLIGHT OPERATED BY 3K.
NOTE - TEXT BELOW NOT VALIDATED FOR AUTOPRICING.
PERMITTED CARRIERS/ROUTING AS PER ROUTE MAP.
ADVANCE RESERVATIONS/TICKETING CONFIRMED RESERVATIONS FOR ALL SECTORS ARE REQUIRED AT
LEAST 50 DAYS BEFORE DEPARTURE.
WAITLIST NOT PERMITTED.
TICKETING MUST BE COMPLETED WITHIN 3 DAYS AFTER
RESERVATIONS ARE MADE OR AT LEAST 50 DAYS BEFORE
DEPARTURE WHICHEVER IS EARLIER.
MINIMUM STAY NO MINIMUM STAY REQUIREMENTS APPLY.
MAXIMUM STAY TRAVEL FROM LAST STOPOVER MUST COMMENCE NO LATER THAN
3 MONTHS AFTER DEPARTURE FROM FARE ORIGIN.
STOPOVERS 2 STOPOVERS PERMITTED IN EACH DIRECTION
LIMITED TO 1 FREE AND 1 AT HKD 500.
NOTE - TEXT BELOW NOT VALIDATED FOR AUTOPRICING.
INFANT DISCOUNTS - APPLY - INFANT PAYS 10 PERCENT
OF THE ADULT FEES.
CHILD DISCOUNTS - DO NOT APPLY PAY FULL ADULT FEE.
---
STOPOVERS PERMITTED ONLY AT TRANSFER POINTS SHOWN
ON THE ROUTE MAP.
TRANSFERS UNLIMITED TRANSFERS PERMITTED ON THE PRICING UNIT.
FARE BREAK AND EMBEDDED SURFACE SECTORS PERMITTED ON
THE FARE COMPONENT.
NOTE - TEXT BELOW NOT VALIDATED FOR AUTOPRICING.
AS PER ROUTE MAP.
...
For more information, try building a route using http://matrix.itasoftware.com, and inspecting the rules of the fares it suggests at the end of the process.
Right, so you have a fare, now you need some flights to apply it to.
First, better check the fare's routing map, to see what routes the fare actually allows.
V FARE BASIS BK FARE TRAVEL-TICKET AP MINMAX RTG
1 S50HK3 S R 644.00 ---- 50/3 -/ 3M EH01
PASSENGER TYPE-ADT AUTO PRICE-YES
FROM-HKG TO-SYD CXR-QF TVL-23JUN15 RULE-7380 IPRPG/8
FARE BASIS-S50HK3 SPECIAL FARE DIS-E VENDOR-ATP
FARE TYPE-XEX RT-REGULAR EXCURSION
HKD 4990 7180 E24MAR15 D-INFINITY FC-S50HK3 FN-
SYSTEM DATES - CREATED 23MAR15/0016 EXPIRES INFINITY
PUBLISHED RTG HKG-SYD/QF7180/TAR-TGRG EF-24MAR15 DIS-INDEF
/WITHIN THE EASTERN HEMISPHERE/
MAP CONSTRUCTED LEFT TO RIGHT AND RIGHT TO LEFT
1. HKG-SYD
.
Great, so this fare will only cover us travelling directly between HKG and SYD (route number 1) on either QF, CX, IE, or 3K (those four carriers were listed as allowed in the fare rules). If we wanted to go via MEL we would need to get another fare, or maybe a combination of two fares. Some fares give a mileage restriction instead of a route map (so you can use it on any combination of flights [unless restricted by the rules] but only up to a total mileage).
Next we need to have a look at QF flights between HKG and SYD, remembering every flight must satisfy the conditions of the rules given above. (I am going to ignore the possibility we could use this fare to cover CX/IE/3K for brevity.)
The airline helpfully publishes a list of flights onto the GDS together with the number of seats it is presently willing to sell on the flight organized by "bucket" or "booking code".
This is called the "availability". It can differ by sales city again, so a travel agent in NYC might be able to offer you a better price than a travel agent in LON, even for exactly the same journey. Most airlines do not distinguish on point of sale like this, but some do. Legal restrictions apply to this practise within the EU (see Regulation EC 1008/2008).
Anyway, looking on the 1st October, from London, on QF flights between HKG-SYD, there is just one and the availability is:
Frequency
Flight Stops Depart Arrive Aircraft Reliability Available Classes
0 Connections
QF 128 0 HKG SYD 744 Unavailable J9 C9 D9 I0 W9 R0 T0 Y5 B0 H0 K0 M0 L0 VC SC NC QC OC XC E0
01/10/15 20:15 02/10/15 7:20 75% / 54m
The key part is that last block:
J9 C9 D9 I0 W9 R0 T0 Y5 B0 H0 K0 M0 L0 VC SC NC QC OC XC E0
It tells you that if your fare allows you to book into "J" class, you can reserve 9 seats on this specific flight. There might be more than 9 seats available, the maximum it will display is 9. If your fare lets you book into Y class, you can buy 5 seats in one transaction. If your party is of six people, you will need to pick another fare for the sixth person. (Some booking sites would put everyone in the higher class, at a higher cost for all.) If your fare allows you only to book into M class, alas that has zero seats. If you want a "confirmed reservation" right now, you are out of luck.
The letters J, C, D, and I represent business class; W, R, T is premium economy and the rest are economy. The letter at the left is the "most available" (and the fares allowing it are the most expensive), gradually getting cheaper but more restricted as we read towards the right. Actually each airline can use their own set of letters, but it is normal that the most-available ("full fare") business class is J or C, full fare economy is Y and full fare first is F or P.
Now I should emphasise, the numbers there can change by the second. It is not quite "how many seats are left". It is an active estimate by the airline of how high they can set the price. Of course, when a seat is bought, it is likely that the availability will decrease. But if demand is unexpectedly weak, it might make sense for the airline to keep the availability open. On the other hand if it is announced that the World Cup is going to be set in Sydney next year, it makes sense to tighten up the availability now and therefore raise the price.
For the airline it is a big problem that a typical purchaser will put hundreds, thousands or probably millions of availability requests through before he purchases a single flight. This has become an intolerable load on the airlines, and therefore the availability information tends to be cached at many levels between the airline and your screen. It can therefore be out of date very quickly.
To make life even more difficult, the airlines often like "to marry" segments together, so that the availability on one flight depends on what other flights you propose to take in conjunction with it! Basically, if the airline discovers that you want to take a small but popular flight as part of a big and profitable journey, they can be more liberal in opening up the "cheap seats" for you.
Turning back to our ticket buying: when the availability says 0 you may still put in a "request" to be added to the waitlist. The airline will decide whether to confirm your reservation at its discretion in its own time. If the reservation is confirmed, you may pay for the ticket at this point. Whether the fare permits waitlisting will be written in the rules. [This dirt cheap fare "S50HK3" we are looking at does not allow waitlisting.]
If the fare you intend to use to cover this part of the journey only allows you to sit in S class, then alas that fare bucket (or "booking code") has been closed ("C") to waitlisting: you cannot even ask nicely for a seat.
So which booking code are we allowed to use under our fare? The fare is called "S50HK3" so normally that would be the S booking code. In most cases the first letter of the fare name decides the booking code. However, there can be exceptions for specific flights [most obvious example: if you had a first class fare but not all planes have first class], and to be sure we need to check the Booking Codes table attached to the fare.
>$LB1
001 HKGSYD 01OCT15 QF GBP 414.00 S50HK3 STAY---/3M BK-S
FARE CLS EXPLANATION BOOK CODES
-------- ---------------------- ----------
S50HK3 REGULAR EXCURSION FARES S
S50HK3 WITHIN AREA 3 FOR ROUND TRIP FARES
NO BOOKING CODE EXCEPTIONS FOR CARRIER - USE PRIME
Okay so we should use the S code. Alas! The S bucket is closed. So now we go back to the beginning and pick the next cheapest fare on the list.
Once we have done this we will need to repeat the process with the return trip. And then we need to ensure the two fares are mutually compatible with each other.
As you can see, pricing an airfare is a complicated business and requires a lot of work. This was a very simple example of a round trip fare. When you get into multicities, where for example, because of "stopovers", several cities might be covered by one fare, or you need to use fares from multiple carriers: it can be computationally very difficult to compute the lowest allowed price. People like http://www.itasoftware.com make a lot of money designing algorithms to compute the lowest price.
I should emphasize that actually this is a problem for the airlines too. They have over the years created a system which is so complex that they cannot predict it perfectly either. This is why "error fares" remain quite common. There is also a lot of inertia in this system. It is used by hundreds of airlines and millions of travel agents, and is written into huge computer systems worth billions of dollars. It cannot be changed easily.
While you will need a good travel agent sometimes, most of this is actually done these days by websites that sit on top of this 1980s interface. So thousands of these calculations are done every time you want to find out a price for a simple trip.
All the time the "availability" (those numbers we saw at the end) is being constantly manipulated by the airlines to keep the price at the right level to keep the flight maximally profitable.
It is my intention to demonstrate here, as well as giving a flavour of how it works, that pricing an airfare is a difficult mathematical problem to solve. Indeed, it has been proven that, strictly speaking, the problem is "undecidable", that is to say, it is mathematically impossible to design an algorithm that will always find the lowest allowable price under every circumstance.
Many people suggest that the price of a journey automatically rises when you compare several fares. But you can see from my description above that this would be technologically challenging to implement to say the least. (It would probably also be illegal.) In practise, is more likely that the availability is being miscomputed or cached somewhere between the airline and your screen.