What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To plan travel with a graph database, represent places such as airports and stations as nodes, and the services between them as directed relationships. Add distance, duration, fare, and schedule information only where your queries need it. Then choose a pathfinding method that optimizes the right thing: the fewest legs, shortest distance, or lowest travel time are different questions.

What should a travel graph represent?

Start with the entities your route queries need to distinguish. Airports, stations, stops, cities, countries, and regions can each be nodes when that distinction helps answer a question. A basic airport model might use an airport node with an IATA code, name, and location, connected to other airports by directed :HAS_ROUTE relationships. A relationship can carry a distance or another route cost. Neo4j’s airport pathfinding training demonstrates this kind of airport network and geographic hierarchy.

Make direction explicit. A service from A to B does not necessarily mean there is a service from B to A. Likewise, a connection in the graph should not imply that a vehicle operates at the requested time unless the schedule data supports that conclusion.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep route details on the right entity

For simple network questions, such as finding a path between airports, a direct relationship with a distance or cost property may be enough. For service-centered questions—filtering by flight number, carrier, or schedule—consider modeling each flight or trip as its own entity, connected to its departure and arrival locations. Neo4j’s airport-model tutorial introduces a Flight concept to support flight-focused queries.

This distinction helps avoid treating all services on the same city pair as interchangeable. Whether the service belongs on a relationship or a separate node depends on the queries and constraints the application must evaluate.

How do you model schedules and transfers?

A route can exist in the network but still be unusable for a particular itinerary. Services may run only on certain days, vary by season, or require enough time to transfer. Keep schedule validity, operating calendars, and data provenance with the schedule information, and make the query check them against the requested travel date.

For multimodal journeys, model the train and bus segments and the transfers between them. Transfer rules—such as minimum connection time—must be represented in a form the route query can evaluate. A Neo4j journey-planning example combines train and bus services, locations, traveler position, and transfers. California DOT’s preliminary investigation of graph databases for transportation data integration discusses the challenge of integrating transportation data from multiple sources.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Graph pathfinding works only with the network and operational data supplied to it. It does not automatically establish live availability, ticket prices, disruption status, complete schedules, or whether a transfer is legally or practically feasible.

Which pathfinding method fits the route question?

Decide what “best” means before choosing an algorithm. A route with the fewest legs may be longer or slower than another route. A weighted path can optimize a selected cost, but the cost definition and algorithm assumptions must match the problem.

  • Fewest connections: Use an unweighted shortest-path search when every leg counts equally and the goal is to minimize the number of connections.
  • Lowest weighted cost: Dijkstra’s algorithm is suitable for positive relationship weights. Neo4j’s Graph Data Science documentation describes source-to-target and single-source variants for finding paths using a weight property. See its source-target Dijkstra documentation and single-source Dijkstra documentation.
  • Spatially guided search: A* can use location coordinates to guide a search through a transport network. Neo4j’s A* example uses station latitude and longitude with distance; ensure the heuristic and route cost fit the network.
  • Several candidate routes: Yen’s k-shortest-paths method can return multiple candidate paths. It is covered in Neo4j’s pathfinding course.

Distance, duration, fare, or a combined score can serve as a weight, but they answer different needs. A combined score also requires a clear rule for balancing components—for example, a traveler’s preference for time versus price. Do not treat an algorithm example as evidence that a particular method or database is best for every production network.

How should you identify a useful hub?

A hub is useful only in relation to a specific travel question. A high number of direct connections measures connectivity, not necessarily the hub’s usefulness for a passenger’s itinerary. Consider the metric alongside the journeys and operating conditions that matter.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Connections and reach: Count available connections or destinations reachable from the hub.
  • Journey quality: Compare travel time, transfers, or a clearly defined generalized cost for the target journeys.
  • Schedule coverage: Check frequency and which days services operate.
  • Alternatives: Assess whether other feasible paths remain when a service is unavailable.
  • Geographic and market role: Consider the locations and passenger markets the hub is meant to serve.

WestJet illustrates why connection counts alone do not describe routability. In a vendor-hosted Neo4j customer story, Luka Petrovic, a WestJet software developer, said that about 35% of the airline’s origin-and-destination airport pairs were routable in its network. That figure describes WestJet’s network, not a general rate for airlines or travel systems. The same undated case study describes a flight-schedule graph with 500,000 nodes and 5 million relationships, and reports that the IT team was 530% faster at updating the online flight schedule. These are customer outcomes published by the vendor, not independently controlled database benchmarks. See the WestJet customer story.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What does a real travel graph need beyond route edges?

Transport data integration is part of the problem, not an afterthought. A system may need to combine locations, services, schedules, and transfer rules from different sources while preserving their validity and provenance. California DOT’s preliminary investigation notes that graph suitability for shortest-path transportation workloads involves trade-offs and cites a 2023 study of London’s multimodal transport network. This supports evaluating the data-integration problem and workload together; it does not establish a universal performance winner.

For a real deployment, compare database options using the same data, route constraints, update patterns, hardware, and query workload. The available examples show practical graph models and algorithms, but do not provide an apples-to-apples performance comparison across database platforms.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.