Technical explainer

Flight combination search: the math of permutations.

Most flight tools are good at evaluating one specific trip. Combinatorial flight search flips the question: instead of pricing a fixed itinerary, it generates and prices many valid itineraries from your constraints, then ranks them. This page explains the math behind why that produces different — often cheaper — answers.

The state space, in one formula

For a trip with n destinations, an average of k nearby-airport alternatives per city, and a date window of d days around your target dates, the number of valid one-trip orderings is roughly:

combinations ≈ n! × k^n × d

With n=3 cities, k=2 airport options each, and a d=5 day window, you're already past 240 valid routings before you consider airline pairings or hotel splits. That's far past what a human is willing to type into a search box.

247
combinations tested
$1,847
below entered baseline
60s
search depth

Example demo data — not aggregated user statistics.

Why permutation order changes total price

Airfare isn't symmetric. A leg priced at $480 from JFK to CDG might be $612 in the other direction the same week, because each carrier's revenue management treats outbound and return capacity independently. When the order of your three cities changes, the most expensive leg of the trip lands in a different fare bucket, on a different carrier, possibly on a different day of week.

On a real Tel Aviv → Paris → New York → Tel Aviv trip, reversing the middle two cities can move the trans-Atlantic leg from a peak weekend slot to a midweek one and shave $200–$400 off the total — without changing what the traveler actually does on the ground.

The cost of date flexibility

A single day of flexibility on each leg of a 3-leg trip multiplies the search space by roughly 3³ = 27. Most travelers have at least that much real flexibility but never enumerate it because the manual work is brutal. A constraint engine does it in milliseconds and surfaces the savings the form-based search couldn't see.

Hotel-night splits as a constraint

Once you allow the trip to keep total nights fixed but shift them between cities, every redistribution is a separate priced itinerary. "5 nights total: 1 in Paris, 4 in NYC" and "2 in Paris, 3 in NYC" are different problems. The engine evaluates each split against current hotel inventory and includes the result in the ranking.

Internal links

Frequently asked

What is combinatorial flight search?

It's an approach where the engine enumerates many valid permutations of a trip — city order, date offsets, nearby airports, airline pairings — then ranks them against your hard rules and a baseline price. The user describes the trip; the engine handles the combinations.

Why does permutation order change the total price?

Each routing has different fares for individual legs, different overnight requirements, and different overlap with weekend and holiday peaks. Reversing a city order can shift the most expensive leg into a cheaper fare bucket.

How much does date flexibility help?

A ±2 day window typically multiplies the search space by 5–25× and uncovers savings of 10–30% on multi-city itineraries because at least one leg almost always has a softer fare on an adjacent day.

Is this just a meta-search?

Meta-searches query providers and merge results for a single trip you specify. Combinatorial search runs many specifications against the same provider data and chooses the best one. They're complementary techniques.

Does SnagRid sell tickets?

No. SnagRid surfaces the cheapest valid combination and the booking order. Booking happens on the providers' own sites.

Try SnagRid on your trickiest trip.

Free preview, no signup. Paste your trip in plain English.

Start a free preview