Location-Data-Driven Travel Itinerary Planning: A System Design Practice

    This article explains how to convert unstructured travel notes into executable itineraries using structured POI modeling, multimodal routing with time windows, constraint and seasonal availability modeling, in-scenic-area micro-planning, queue prediction, and expectation management. Using a two-day trip case, it presents practical data schemas and algorithms, including greedy route construction with local search and simple queue-time integration.

    Why Itinerary Planning Is a Typical Technical Problem

    Travel guide content is abundant online, but most of it is organized as natural-language travelogues with low information density and poor structure. Users often do not need “a guide”; they need an executable itinerary: what time to leave, which transport to take, how long to stay, where to eat, and what the budget is. Converting unstructured travelogues into structured itinerary services essentially requires solving four subproblems:

    1. Extraction and structuring of point-of-interest (POI) data;
    2. Route planning and time estimation between multiple points;
    3. Itinerary constraint modeling (opening hours, open seasons, transport mode restrictions, etc.);
    4. User-preference-oriented recommendation and ranking.

    The following uses a real two-day trip case—an ancient town, a lake scenic area, and local dining in a western tourism city—to break down the design approach for this system step by step.

    POI Data Modeling

    The first step in itinerary planning is to extract information from guide text into structured data. A typical POI should include at least: name, geographic coordinates, category, ticket fee, recommended stay duration, opening hours, transit connection information, and negative tags (such as seasonal restrictions).

    1. {
    2. "poi_id": "P001",
    3. "name": "Jianchang Ancient City",
    4. "category": "Historic district",
    5. "ticket_fee": 0,
    6. "stay_minutes": 120,
    7. "open_hours": [["09:00", "22:00"]],
    8. "transit": ["Bus 16", "Transfer at high-speed rail station to 20/K1"],
    9. "tags": ["night tour", "food", "free"],
    10. "risk_notes": ["Low preservation of original historic appearance after renovation"]
    11. }

    For extraction, POI names can be extracted from UGC text through named entity recognition, coordinates can then be completed through a geocoding service, and stay duration and tags can be extracted using rules plus classification models. Risk information (such as “avoid the burning season” or “some districts have a poor environment”) should be retained as independent constraint fields rather than simply discarded. This kind of “negative knowledge” is highly valuable in the ranking stage.

    Route Planning: More Than Shortest Path

    Movement between attractions is the core of itinerary planning. The classic TSP (traveling salesman problem) can be solved directly when the number of attractions is small, but real scenarios also require time-window constraints, which forms the TSPTW (traveling salesman problem with time windows).

    For small-scale scenarios such as a two-day trip (usually fewer than 10 POIs), a practical approach is:

    1. Use a road network service to calculate the actual travel time between any two points, distinguishing four modes: driving, public transit, walking, and cycling;
    2. Build a time-cost matrix;
    3. Construct an initial solution with a greedy method, then optimize it with local search (such as 2-opt exchange).
    1. def plan_route(pois, start_time, matrix, day_capacity=10*60):
    2. route, cur_time, total = [], start_time, 0
    3. remaining = set(pois)
    4. cur = "START"
    5. while remaining:
    6. best = min(
    7. remaining,
    8. key=lambda p: matrix[cur][p["poi_id"]] + penalty(p, cur_time)
    9. )
    10. travel = matrix[cur][best["poi_id"]]
    11. arrival = cur_time + travel
    12. if arrival + best["stay_minutes"] > start_time + day_capacity:
    13. break # Daily capacity reached; switch to next day
    14. route.append((best["name"], arrival))
    15. cur_time = arrival + best["stay_minutes"]
    16. total += travel
    17. remaining.remove(best)
    18. cur = best["poi_id"]
    19. return route, total

    The penalty function penalizes candidates whose arrival time is outside their opening window, preventing infeasible plans such as visiting an ancient town at dawn.

    Constraints and Seasonal Factors

    The source case mentions “avoiding the burning season.” In engineering terms, this maps to POI availability time windows. A real system typically maintains a calendar constraint table:

    1. {
    2. "poi_id": "P002",
    3. "blackout_ranges": [["02-01", "04-15"]],
    4. "reason": "Fire-prevention period; some areas have flow limits or are closed"
    5. }

    The planner first filters unavailable POIs during the selection stage, and during ranking it gives weight to season-sensitive but available attractions (such as winter-only migratory bird viewing). This is where data-driven recommendations are more fine-grained than human-written guides: bird occurrence probability can be modeled weekly from historical observation data and dynamically adjust recommendation weights.

    Micro-Planning Inside Scenic Areas

    Large scenic areas (such as a lake loop of 35–40 km) often have independent transport systems: some road sections prohibit social vehicles, there are flag-stop sightseeing buses, and there are fixed-fare water buses. This requires modeling the scenic area as a “layered road network”—the outer layer is the city road network, the inner layer is the scenic walking network plus shuttle network, and the two layers are connected through transfer nodes.

    In engineering implementation, a separate shuttle line table can be maintained for the scenic area:

    1. {
    2. "zone": "Lake Ring Scenic Area",
    3. "shuttle_lines": [
    4. {"line": "Wetland Park–Small Fishing Village", "mode": "bicycle/sightseeing bus", "fare": 10, "flag_stop": true},
    5. {"line": "Lakeside Park–Small Fishing Village", "mode": "boat", "fare": 30}
    6. ],
    7. "car_restriction": "Private cars are prohibited within Walnut Village and beyond"
    8. }

    Waiting time for flag-stop transfers is uncertain. It is advisable to add an empirical buffer (such as 15–20 minutes) to time estimates; otherwise, the error in the entire itinerary will accumulate stop by stop.

    Dining Recommendations and Queue Prediction

    Information such as “queues start at 4 p.m.” in guides is very valuable. The corresponding technical capability is popularity time-series modeling. Per-POI visitor flow series can be maintained by time bucket, and a simple historical average or time-series model can be used to predict waiting time. Queue time should then be included in stay duration during itinerary planning:

    1. estimated_wait = queue_model.predict(poi_id, arrival_hour)
    2. effective_stay = base_stay + estimated_wait

    When the predicted wait exceeds a threshold, the system can automatically adjust the dining window (for example, arriving before 16:30 during off-peak hours). This is exactly the advantage of structured data over humans reading guides.

    Data Quality and Handling of “Negative Reviews”

    The source mentions drawbacks such as algae on the lake surface and the ancient town losing its historic feel after renovation. A good recommendation system should not only aggregate positive reviews; it should explicitly model downside dimensions:

    1. Environmental hygiene, authenticity, and crowding should be independent rating dimensions rather than being aggregated into a single total score;
    2. Result displays should retain “gap vs. expectations” hints (for example, “water clarity differs from well-known alpine lakes”);
    3. Comparative references (“an experience similar to X”) can help users calibrate expectations and reduce negative feedback from post-trip regret.

    This kind of expectation-management capability often has a greater impact on product retention and review credibility than simply improving recommendation accuracy.

    Summary

    Converting a travelogue into an executable itinerary service requires five stages: information structuring, multimodal road-network planning, constraint modeling, time-series prediction, and expectation management. There are three core lessons: first, negative information is as important as positive information and should enter the data model as a first-class citizen; second, itinerary planning is not purely an algorithmic problem—dirty details such as in-scenic-area shuttles and queue waiting determine whether a plan can truly be implemented; third, for small-scale scenarios, simple greedy construction plus local search is sufficient, and there is no need to introduce heavyweight solvers. Following this path, developers can use general map services and a self-built POI database to quickly build reliable itinerary planning capabilities.