I have a set of users and their itinerary details. I want to figure out who all will be sharing a common flight. I do not want to rely too much on the "Departure time" as people could have entered an approximate time into the system. How can I figure this out with minimal information?

Initially, I thought two people with the same flight number and same departure date would be on the same flight. But the same flight can be used again on the same day. Would the combination of "Flight no + departure date + departure city" be enough to identify a unique flight itinerary?

What would be optimal information to identify this?

I also have to keep in mind that there could be people with multiple flights in their itinerary and if at least one flight is common with another passenger, that has to be shown too.

  • 1
    If people are entering this manually, there's already too much drift to worry about the relatively uncommon scenario of an airline reusing a flight number. – Johns-305 Apr 27 '18 at 1:42
  • 4
    I'm voting to close this question as off-topic because it is about administrative planning. – Tor-Einar Jarnbjo Apr 27 '18 at 10:26
  • @Johns-305 Southwest Airlines flight numbers follow a plane through several flights in a day. – robert Apr 27 '18 at 10:45

To fully answer this question you need the administrative operating carrier and flight number, scheduled departure date, departure airport, stops and arrival airport. If all of these are the same the flight will be shared.

You specifically need the administrative operating carrier as there may be multiple marketing carriers for a single flight, so if you look at the marketing carrier and flight number you may get false negatives.

The arrival and destination airport are needed to determine whether the two itineraries overlap on the flight number, as a flight number may consist of multiple stops, where people are sold some subset of the stops. There are flights in Alaska with 6-7 stops, with people getting off and on at each stop. This also means that the question is not yes/no, but yes/no/partially.

You suggest that people are going to be entering information into the system. Most people will only know their marketing carrier and flight number and not the administrative operating carrier. As such, you may have to source a timetables dataset to map marketing flight numbers to administrative operating flight numbers.

  • Note: just because the flight is shared does not mean the plane is, if that matters. I know of at least one small airline in Oceania which only has small planes, and thus may schedule several small planes on the same flight if there's enough demand :) – Matthieu M. Apr 30 '18 at 7:10
  • @MatthieuM.Which is another thing entirely, and I don't think theres any way to deal with that. – user1937198 Apr 30 '18 at 21:12

I once flew from Auckland International to Great Barrier Island, and upon checking in different passengers were given different coloured boarding cards (as far as I know each group was given only one colour). These corresponded to different aircraft that we would be travelling on, even though we had nominally the same flight number, departure time, departure airport, and destination airport.

So, I do not think there is a general answer to your question.

  • 1
    Historically, this was also true for a number of shuttle services, including those in the US Northeast (ended early 2000s), and BA Super Shuttle out of LHR (ended mid 90's). A seat was guaranteed to available on any flight without a reservation; if they ran out, they'd fly a second airplane. – user71659 Apr 26 '18 at 23:01

You've really got two separate questions here - one of which is potentially a fit for here (although Aviation.SE might be a better fit). The other belongs on one of the more computer science SE sites...

Firstly, around the minimum set needed to know if two people are on the same flight. With some very corner case exceptions (eg, very small aircraft flights that run "on-demand" rather than being on a true schedule), the combination of flight number, departure city, and scheduled departure date will give you a unique combination. (I specifically call out scheduled departure date, as the actual departure date could change due to a delay, at which point these details will not be unique).

The need for the flight number and departure date is hopefully obvious. The need for the departure city is required because, as you called out, flight numbers can be reused even on the same day.

With some very (very!) small airlines there may still be conflicts, but these will be at least extremely rare, and short of adding in schedule departure time (which you've said you don't want to do) will generally not be something you can resolve.

The second part of your question around how to actually detect two people are on a common flight, given the information above, is a question for another site in the StackExchange network, not this one.

  • 1
    This is not quite right. If I am leaving Basel today on flight KL1988, and you are leaving Basel today on flight AF8327, then we are going to be on the same plane. (It's a KLM/Air France code-share). – Martin Bonner supports Monica Apr 27 '18 at 10:59

Airlines will keep flight numbers unique per day and departure airport (not city - some cities have multiple airports). The ATC system can't handle two planes in the air at the same time with the same flight number.

So you need to look at the combination of
date-flight #-departure airport.

This assumes that flight# includes the airline code.

  • 3
    You are confusing flight numbers (used by the airline/airport) with callsigns (used by an individual flight/ATC). There CAN be two flights with the same flight number in the air at the same time. There can NOT be two flights with the same callsign in the air at the same time. Call signs are normally related to the flight number, but if there's a need they will be changed - normally by adding an extra letter on the end. eg, flight BA123 might have the callsign "Speedbird 123 Tango" (where "speedbird" is the callsign code for BA) – Doc Apr 26 '18 at 16:47
  • @Doc , no, I am aware of the difference. Airlines don't assign the same flight number to avoid this, but if it happens because of delays or plane changes, call signs get differentiated by a letter. However, in the context of this question, people are booked on flight numbers, not on call signs – Aganju Apr 26 '18 at 23:33
  • Well, you did say "the ATC system can't handle two planes in the air at the same time with the same flight number", which apparently isn't true... perhaps you should edit your answer? – Sneftel Apr 27 '18 at 9:59
  • You forget about code sharing. It is not uncommon that one flight has multiple flight numbers. – Tor-Einar Jarnbjo Apr 27 '18 at 10:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.