Work Hard/Play Hard Problem
- Find optimal route from an origin to a destination and vice versa (side conditions apply, like time constraints or different discounts, applied to flights of same airline or of airlines of common "alliances").
- Find optimal routes encompassing the destination point and each of any number of additional destinations. Order of intermediate destinations does not matter.
Read input file. Build a graph with all flight targets and destinations as nodes. If a flight's depature time lies outside of the specified time window, ignore it.
Divide the problem up into partial routes connecting each two locations. Then, for each partial route:
Find a set of potentially cheapest routes by performing a breadth-first search on the flight graph. Consider side conditions (time frame) whenever necessary.
Apply flight discounts while building possible routes. Since final prices cannot be determined due to potential discounts, use fuzzy price ranges, describing the lowest and highest possible costs of each route.
Ignore route if lowest possible price is greater that highest possible price of cheapest known route.
Merge two sets of possible partial routes by building carthesian product of partial routes. Consider side conditions. Cheapest route of merged is solution for problem (1). Use fuzzy price ranges like in (2).
For each additional destination: Like (3). Merge three sets for each additional locations. Cheapest routes are solutions for problem (2).
- Input file is parsed in parallel.
- Partial routes are computed using recursive task-based parallelism.
- Merging of routes is performed using multidimensional parallel loops.
- Use pointers whenever possible!
- Avoid std::strings and use simple *char pointers instead!