Next-Gen DP Algorithm

Plan Smarter.
Travel Boundless.

Experience hyper-optimized itineraries crafted by dynamic programming. Maximize your adventure, minimize your budget, and unlock the world.

São Paulo
Rio de Janeiro
Buenos Aires
Bogotá
Santiago
Lima
Medellín
Cartagena
Cusco
Montevideo

Process

How It Works

From preferences to personalized itinerary in seconds — powered by dynamic programming.

🎯01

Set Your Preferences

Choose your traveler profile, budget, number of cities, and preferred duration per destination.

✈️02

Data Processing

We match available flights and hotels from the corporate travel dataset for your selected origin city.

🧠03

DP Optimization

Our 0/1 Knapsack algorithm finds the optimal city combination that maximizes attractions within your budget.

🗺️04

Get Recommendations

View a personalized itinerary with full cost breakdown, flights, hotels, and attractions for each city.

Trip Planner

Find My Perfect Trip

Configure your travel preferences and let the DP algorithm find the best cities to visit.

$
110
17
✈️

Ready to Plan

Fill in your preferences and click "Find My Trip" to get optimized recommendations.

Under the Hood

The Algorithm

A 3-dimensional 0/1 Knapsack — choosing the optimal subset of cities to maximize attractions within budget and city count constraints.

🎒 The Travel Knapsack Problem

Each candidate city is modeled as a knapsack item. The weight is its total cost (flight + hotel × days), and the value is the number of attractions.

We have two constraints: the total spend must not exceed the budget, and we may visit at most K cities. The classic 2D knapsack becomes a 3D DP.

📐 State Definition

dp[i][k][w] = max attractions using:

  • first i candidate cities
  • • visiting exactly k of them
  • • total cost ≤ w × $50

Budget is scaled by $50 to reduce table size while keeping precision.

🔄 Recurrence Relation

dp[i][k][w] = max(

dp[i-1][k][w]// skip city i

dp[i-1][k-1][w-cost[i]] + value[i]// include city i

)

Base: dp[0][0][w] = 0 for all w

Invalid: dp[i][k][w] = -1 (infeasible)

💻 Pseudocode

ALGORITHM TravelDP(cities, budget, maxCities):
  B ← budget / SCALE
  dp[0..n][0..K][0..B] ← -∞
  dp[0][0][0..B] ← 0          // base case

  FOR i = 1 TO n:
    cost  ← ceil(cities[i].totalCost / SCALE)
    value ← cities[i].attractions
    FOR k = 0 TO K:
      FOR w = 0 TO B:
        dp[i][k][w] ← dp[i-1][k][w]    // skip city i
        IF k > 0 AND w ≥ cost:
          dp[i][k][w] ← max(dp[i][k][w],
            dp[i-1][k-1][w-cost] + value)

  BACKTRACK to find selected cities
  RETURN optimal city set

⚡ Complexity Analysis

⏱️Time Complexity

O(n × K × B)

  • n = number of candidate cities (up to 14)
  • K = max cities to visit
  • B = budget ÷ $50 scale factor
💾Space Complexity

O(n × K × B)

Reducible to O(K × B) with rolling array — we keep all layers for backtracking.

📊 Example DP Table

Simplified: 4 cities, K=2, budget units of $200

k\w$0$200$400$600$800
k=000000
k=10666
k=21212
0 (base)6 (1 city)12 (optimal)— (infeasible)

Data Source

The Dataset

Based on the Argo Datathon 2019 — synthetic corporate travel data across Latin American and South American cities.

👥

1,000+

Users

Corporate travelers with flight history

📋

250,000+

Travel Records

Flight bookings across the dataset

🌎

15

Cities

Latin American & South American destinations

usersTraveler Profiles

CodeNameGenderAgeCompany
0Carlos Silvamale34Argo Solutions
1Ana Souzafemale28TechCorp
2Miguel Rodriguesmale42InnovateBR
3Valentina Garcíafemale31GlobalCorp
4Lucas Fernandesmale25StartupLab

flightsSample Flight Routes

FromToAgencyTypePriceDuration
São PauloRio de JaneiroFlyingDropseconomic$1340h 57m
Rio de JaneiroSão PauloFlyingDropseconomic$1340h 57m
São PauloRio de JaneiroRainboweconomic$1280h 57m
Rio de JaneiroSão PauloRainboweconomic$1280h 57m
São PauloBuenos AiresFlyingDropseconomic$3682h 56m
Buenos AiresSão PauloFlyingDropseconomic$3682h 56m
São PauloBuenos AiresRainboweconomic$3502h 56m
Buenos AiresSão PauloRainboweconomic$3502h 56m

hotelsSample Hotels

CodeNameCityPrice/Night
AHotel Unique SPSão Paulo (SP)$180
BHotel Ibis SPSão Paulo (SP)$85
CHotel Santa TeresaRio de Janeiro (RJ)$220
DHotel Ibis RioRio de Janeiro (RJ)$90
EHotel Alvear PalaceBuenos Aires (ARG)$210
FHotel Ibis BABuenos Aires (ARG)$75
GHotel Casa MedinaBogotá (COL)$160
HHotel Ibis BogotáBogotá (COL)$65
📚

Argo Datathon 2019

This application uses a synthetic corporate travel dataset inspired by the Argo Datathon 2019 competition. The data represents anonymized business travel patterns across Latin American cities and is used purely for educational purposes.