patsonluk / airline

Apache License 2.0
109 stars 71 forks source link

Fixed super low price ticket might affect network in big cities #562

Closed patsonluk closed 1 year ago

patsonluk commented 1 year ago

Description

Very low price link between big destinations (for example JFK <-> LAX) could affect the demand of other competitors flying exactly the same link.

Cause

The old algorithm first figure out all the route maps and then do the pax consumption. For link with very low price Airport A <-> B, a lot of routes might include such link in the map, but the link will exhaust very early in the consumption iteration and the rest of demand will not able to use the route in that run.

And in the next run, a lot of flights flying into/out of A and B could be exhausted hence pax might not be able to find valid route going in and out of A and B even tho there are still capacity for other links going A <-> B

Solution

Instead of first compute all route maps and then do consumption, we will do compute and then consumption right the way, the links will update dynamically hence exhausted link will be taken out of the route map computation.

This is still not perfect as we still only compute route map on for each pax group on first encounter, which means it could still hold routes of later exhausted link (as we do not recompute until next run), but this should solve the low price low capacity issue as those links should be exhausted very quickly.