<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Routavio</title>
    <description>The latest articles on DEV Community by Routavio (routavio).</description>
    <link>https://dev.to/routavio</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F15366%2F831800e4-05c4-4653-b186-5b5850bead1d.png</url>
      <title>DEV Community: Routavio</title>
      <link>https://dev.to/routavio</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/routavio"/>
    <language>en</language>
    <item>
      <title>When Better Route Optimization Made Our Travel Planner Slower Copy</title>
      <dc:creator>Halil Cinar</dc:creator>
      <pubDate>Sat, 17 Oct 2026 13:38:29 +0000</pubDate>
      <link>https://dev.to/routavio/when-better-route-optimization-made-our-travel-planner-slower-copy-2l9l</link>
      <guid>https://dev.to/routavio/when-better-route-optimization-made-our-travel-planner-slower-copy-2l9l</guid>
      <description>&lt;p&gt;Route optimization is usually evaluated through the quality of the paths an algorithm discovers.&lt;/p&gt;

&lt;p&gt;For a multimodal travel planner, this may involve minimizing journey duration, reducing monetary cost, limiting transfers, or identifying connections through nearby airports.&lt;/p&gt;

&lt;p&gt;However, when route optimization is deployed as an interactive service, another objective becomes equally important: the system must produce useful results without preventing other users from completing their searches.&lt;/p&gt;

&lt;p&gt;While developing &lt;a href="https://www.routavio.com" rel="noopener noreferrer"&gt;Routavio&lt;/a&gt;, a multimodal travel planning and route optimization platform, we encountered a case where extending the graph search budget significantly improved the itineraries discovered for a difficult destination.&lt;/p&gt;

&lt;p&gt;The optimization was technically successful when evaluated in isolation.&lt;/p&gt;

&lt;p&gt;After deployment, however, the longer computations prevented the shared worker from draining its queue. Unrelated searches accumulated, and users began receiving empty result boards while their computations remained pending.&lt;/p&gt;

&lt;p&gt;The change was reverted within an hour.&lt;/p&gt;

&lt;p&gt;This article examines that incident through bounded graph search, queueing theory, service-time distributions, and the architectural constraints of a Node.js worker coordinated through PostgreSQL.&lt;/p&gt;

&lt;p&gt;The implementation and measurements refer to the August 2026 pilot evaluation at repository revision &lt;code&gt;71e8cd39&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Route Optimization Under a Computation Budget
&lt;/h2&gt;

&lt;p&gt;Multimodal travel planning differs from conventional shortest-path optimization in several important ways.&lt;/p&gt;

&lt;p&gt;The transportation network is heterogeneous and incomplete. Some connections are represented by precise schedules, while others depend on externally acquired fare observations or route catalogues.&lt;/p&gt;

&lt;p&gt;The objective is also multicriteria. Travelers may value lower prices, shorter durations, fewer transfers, and reliable connections differently.&lt;/p&gt;

&lt;p&gt;As Martins (1984) demonstrated in the multicriteria shortest-path setting, competing objectives may produce multiple nondominated solutions [1].&lt;/p&gt;

&lt;p&gt;The purpose of Routavio's routing engine was therefore not to find a single mathematically optimal path.&lt;/p&gt;

&lt;p&gt;It was to retrieve a small, diverse set of plausible itineraries within a bounded computation window.&lt;/p&gt;

&lt;p&gt;At the evaluated revision, the system operated over a directed transportation graph containing 24,774 nodes and 228,060 edges.&lt;/p&gt;

&lt;p&gt;The search used heuristically pruned depth-first traversal with two termination conditions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A maximum number of completed candidate paths.&lt;/li&gt;
&lt;li&gt;A wall-clock computation budget.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The search terminated when either bound was reached.&lt;/p&gt;

&lt;p&gt;Geographic-progress constraints, remaining-leg lower bounds, connection feasibility, and itinerary-shape restrictions reduced the candidate space.&lt;/p&gt;

&lt;p&gt;Importantly, those restrictions affected which paths the engine could discover within its available execution time.&lt;/p&gt;

&lt;p&gt;Increasing the search budget could therefore improve the quality of the best discovered result.&lt;/p&gt;

&lt;p&gt;But it could also increase the time during which the worker remained occupied.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. An Airportless Destination Exposed the Trade-off
&lt;/h2&gt;

&lt;p&gt;The relevant experiment concerned a route to Ghent, Belgium.&lt;/p&gt;

&lt;p&gt;Ghent does not have a major commercial airport serving conventional international flight search.&lt;/p&gt;

&lt;p&gt;A practical journey may require reaching a nearby airport and completing the remaining distance using ground transportation.&lt;/p&gt;

&lt;p&gt;This makes it a useful test case for multimodal route discovery.&lt;/p&gt;

&lt;p&gt;The route engine must explore transportation combinations that are not represented by a direct airport-to-airport flight search.&lt;/p&gt;

&lt;p&gt;During the August 2026 pilot investigation, we measured path discovery against a fixed destination and machine.&lt;/p&gt;

&lt;p&gt;The following results were recorded:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Search elapsed time&lt;/th&gt;
&lt;th&gt;Candidate paths found&lt;/th&gt;
&lt;th&gt;Best discovered itinerary duration&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4 seconds&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;3,536 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;15 seconds&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;3,536 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20 seconds&lt;/td&gt;
&lt;td&gt;80&lt;/td&gt;
&lt;td&gt;2,965 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30 seconds&lt;/td&gt;
&lt;td&gt;390&lt;/td&gt;
&lt;td&gt;310 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;45 seconds&lt;/td&gt;
&lt;td&gt;390&lt;/td&gt;
&lt;td&gt;310 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The results showed a threshold-like discovery pattern.&lt;/p&gt;

&lt;p&gt;During the first fifteen seconds, additional computation did not materially improve the best discovered itinerary.&lt;/p&gt;

&lt;p&gt;Between twenty and thirty seconds, however, the search discovered substantially better candidates.&lt;/p&gt;

&lt;p&gt;At thirty seconds, the shortest duration among the recorded discovered itineraries was 310 minutes.&lt;/p&gt;

&lt;p&gt;Extending the observation to forty-five seconds did not improve that result.&lt;/p&gt;

&lt;p&gt;This was not a controlled benchmark establishing global route optimality. It was a diagnostic observation of candidate discovery within a particular graph and workload.&lt;/p&gt;

&lt;p&gt;Nevertheless, it raised a reasonable engineering question.&lt;/p&gt;

&lt;p&gt;If additional search time improves the discovered journeys so substantially, why not increase the computation budget?&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Local Optimization
&lt;/h2&gt;

&lt;p&gt;The immediate interpretation was that the existing search budget terminated certain computations before they reached productive regions of the search space.&lt;/p&gt;

&lt;p&gt;Increasing the budget appeared to offer a direct improvement in itinerary quality.&lt;/p&gt;

&lt;p&gt;The reasoning was straightforward.&lt;/p&gt;

&lt;p&gt;Let:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Q(B) = quality of the best itinerary
       discovered within search budget B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If allowing additional computation improves the best discovered route, increasing &lt;code&gt;B&lt;/code&gt; can improve &lt;code&gt;Q(B)&lt;/code&gt; for that query.&lt;/p&gt;

&lt;p&gt;This does not imply that quality increases continuously.&lt;/p&gt;

&lt;p&gt;The Ghent measurement suggested a discontinuous or threshold-like relationship, with a relatively unproductive interval followed by rapid improvement.&lt;/p&gt;

&lt;p&gt;Such behavior is compatible with bounded heuristic search, where traversal order strongly influences which candidates are discovered before termination.&lt;/p&gt;

&lt;p&gt;Routavio increased the search budget substantially.&lt;/p&gt;

&lt;p&gt;For the isolated case, the decision was supported by the observed discovery curve.&lt;/p&gt;

&lt;p&gt;However, the search engine was not operating in isolation.&lt;/p&gt;

&lt;p&gt;Every computation shared the same worker infrastructure with other incoming route requests.&lt;/p&gt;

&lt;p&gt;The optimization had therefore changed not only the quality of an individual search, but also its potential service time.&lt;/p&gt;

&lt;p&gt;That distinction became decisive.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The Shared Computation Architecture
&lt;/h2&gt;

&lt;p&gt;Routavio separated its user-facing Next.js application from a Node.js worker responsible for route computation and transportation data acquisition.&lt;/p&gt;

&lt;p&gt;Computation requests were persisted in PostgreSQL.&lt;/p&gt;

&lt;p&gt;The worker claimed pending requests using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;SKIP&lt;/span&gt; &lt;span class="n"&gt;LOCKED&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PostgreSQL's &lt;code&gt;LISTEN/NOTIFY&lt;/code&gt; mechanism provided event-driven notification of queued work.&lt;/p&gt;

&lt;p&gt;The architecture supported four logical computation slots.&lt;/p&gt;

&lt;p&gt;However, the graph traversal itself was synchronous JavaScript running inside one Node.js worker process.&lt;/p&gt;

&lt;p&gt;All four slots shared the same JavaScript event loop.&lt;/p&gt;

&lt;p&gt;Consequently, four logical slots did not represent four independently executing CPU-bound search workers.&lt;/p&gt;

&lt;p&gt;This distinction matters because concurrency and parallelism are not equivalent.&lt;/p&gt;

&lt;p&gt;The application could have several computations in different stages of execution, particularly while awaiting upstream I/O.&lt;/p&gt;

&lt;p&gt;But a long synchronous graph traversal occupied the event loop and delayed other JavaScript work in that process.&lt;/p&gt;

&lt;p&gt;Increasing logical concurrency could not independently increase available CPU execution capacity.&lt;/p&gt;

&lt;p&gt;The worker was therefore vulnerable to computations that occupied the shared execution resource for excessive periods.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Queueing Theory and Service Time
&lt;/h2&gt;

&lt;p&gt;The relationship between request arrival rates, processing time, and queue occupancy can be examined through queueing theory.&lt;/p&gt;

&lt;p&gt;Define:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;λ = mean arrival rate of computation requests

S = service time required by a computation

E[S] = mean service time

μ = effective service capacity

ρ = utilization of the constrained service resource
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Under a simplified single-server model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;μ = 1 / E[S]

ρ = λ × E[S]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a stable queue under the assumptions of this model, the average arrival rate must remain below the effective service capacity.&lt;/p&gt;

&lt;p&gt;Equivalently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ρ &amp;lt; 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The actual Routavio worker included asynchronous provider I/O, multiple logical slots, and shared system resources. Therefore, the single-server model is an approximation of its synchronous CPU-bound execution bottleneck, not a complete performance model of the implementation.&lt;/p&gt;

&lt;p&gt;Nevertheless, it illustrates the operational risk of increasing average service time without increasing effective processing capacity.&lt;/p&gt;

&lt;p&gt;If incoming work arrives faster than the constrained resource can process it over a sustained interval, queued work accumulates.&lt;/p&gt;

&lt;p&gt;A longer computation budget can therefore increase queue pressure, even when it produces better results for the individual request.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Little's Law and End-to-End Response Time
&lt;/h2&gt;

&lt;p&gt;Little (1961) established the fundamental queueing relationship:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;L = λ × W
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;L&lt;/code&gt; is the mean number of jobs in the system.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;λ&lt;/code&gt; is the mean effective throughput.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;W&lt;/code&gt; is the mean time a job spends in the system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The relationship applies under appropriate steady-state and stability assumptions [2].&lt;/p&gt;

&lt;p&gt;This qualification is important.&lt;/p&gt;

&lt;p&gt;Little's Law does not directly predict the behavior of an overloaded transient queue, and it does not imply that increasing service time always produces a particular numerical increase in waiting time.&lt;/p&gt;

&lt;p&gt;However, it clarifies how queue occupancy, throughput, and response time are related when the system operates in a stable regime.&lt;/p&gt;

&lt;p&gt;For an interactive travel planner, total response time includes more than graph traversal.&lt;/p&gt;

&lt;p&gt;A simplified decomposition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Response Time =
    Queue Waiting Time
  + Computation Service Time
  + Other Request Processing Time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An optimization that improves the quality of a route while extending computation service time may increase both the direct cost of that request and the waiting experienced by subsequent requests.&lt;/p&gt;

&lt;p&gt;The second effect can dominate the user experience when the worker is operating close to its effective capacity.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Why Waiting Time Can Grow Nonlinearly
&lt;/h2&gt;

&lt;p&gt;The relationship becomes more pronounced as resource utilization approaches saturation.&lt;/p&gt;

&lt;p&gt;Kingman's work on single-server queues in heavy traffic provides an important theoretical basis for understanding increasing waiting time under high utilization [3].&lt;/p&gt;

&lt;p&gt;For illustration, consider an idealized M/M/1 queue with Poisson arrivals and exponentially distributed service times.&lt;/p&gt;

&lt;p&gt;Its expected total time in the system is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;W = 1 / (μ - λ)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Equivalently, using utilization:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;W = E[S] / (1 - ρ)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These formulas depend on the specific M/M/1 assumptions.&lt;/p&gt;

&lt;p&gt;They are not empirical measurements of Routavio.&lt;/p&gt;

&lt;p&gt;Consider a hypothetical system receiving 0.08 jobs per second.&lt;/p&gt;

&lt;p&gt;If mean service time is ten seconds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;λ = 0.08 jobs/s
E[S] = 10 s

ρ = 0.08 × 10
ρ = 0.80

W = 10 / (1 - 0.80)
W = 50 s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now suppose mean service time increases to twelve seconds, with the same arrival rate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;λ = 0.08 jobs/s
E[S] = 12 s

ρ = 0.08 × 12
ρ = 0.96

W = 12 / (1 - 0.96)
W = 300 s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this simplified hypothetical example, a 20% increase in mean service time produces a much larger increase in expected response time.&lt;/p&gt;

&lt;p&gt;The values are illustrative and should not be interpreted as Routavio benchmarks.&lt;/p&gt;

&lt;p&gt;The point is the nonlinear sensitivity of waiting time to utilization near saturation.&lt;/p&gt;

&lt;p&gt;An apparently moderate increase in computation duration may have disproportionate consequences for a heavily utilized shared worker.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. What Happened After Deployment
&lt;/h2&gt;

&lt;p&gt;The longer search budget was deployed following the Ghent investigation.&lt;/p&gt;

&lt;p&gt;Within approximately one hour, the pilot environment showed that the change was harmful at the system level.&lt;/p&gt;

&lt;p&gt;Two passes operating under the higher budget roughly doubled worst-case computation time.&lt;/p&gt;

&lt;p&gt;The single worker could no longer drain the incoming request queue effectively.&lt;/p&gt;

&lt;p&gt;Requests unrelated to the original difficult destination accumulated in the pending state.&lt;/p&gt;

&lt;p&gt;Users encountered empty result boards because their route computations had not completed in time.&lt;/p&gt;

&lt;p&gt;The engineering report describes the problem as queue starvation caused by increased computation service time.&lt;/p&gt;

&lt;p&gt;This is a critical distinction from an algorithm that simply becomes slower.&lt;/p&gt;

&lt;p&gt;The increased budget improved the opportunity for one computation to discover a better itinerary, but it also reduced the worker's availability to serve other computations.&lt;/p&gt;

&lt;p&gt;As a result, the overall system delivered a worse experience.&lt;/p&gt;

&lt;p&gt;The optimization was reverted.&lt;/p&gt;

&lt;p&gt;The evidence justified the reversal even though the original single-query measurement remained valid.&lt;/p&gt;

&lt;p&gt;The mistake was not measuring the Ghent search incorrectly.&lt;/p&gt;

&lt;p&gt;It was treating the result of an isolated search-quality experiment as sufficient evidence for a system-wide computation-budget policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Search Quality Must Be Evaluated as a System Objective
&lt;/h2&gt;

&lt;p&gt;The incident suggests that search quality and service performance should not be optimized independently.&lt;/p&gt;

&lt;p&gt;A simple formulation might consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;maximize:
    Expected Itinerary Utility

subject to:
    Computation Budget
    Queue Stability
    Response Time Targets
    Provider Quotas
    Memory Constraints
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, itinerary utility may incorporate journey duration, price, transfer count, connection feasibility, and candidate diversity.&lt;/p&gt;

&lt;p&gt;The operational constraints limit the computation resources available to improve that utility.&lt;/p&gt;

&lt;p&gt;One can also define a conceptual objective that penalizes system-level performance degradation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;J =
    Expected Route Utility
  - α × Expected Response Time
  - β × Resource Consumption
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The coefficients &lt;code&gt;α&lt;/code&gt; and &lt;code&gt;β&lt;/code&gt; represent design trade-offs.&lt;/p&gt;

&lt;p&gt;This expression is an analytical abstraction, not an objective function implemented or calibrated in Routavio.&lt;/p&gt;

&lt;p&gt;Its purpose is to show why algorithmic improvements must be assessed against system-level costs.&lt;/p&gt;

&lt;p&gt;In an interactive environment, users benefit from useful itineraries only if those itineraries are delivered within a practical waiting period.&lt;/p&gt;

&lt;p&gt;The quality of an unfinished search is not equivalent to the quality of a delivered recommendation.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Improving Search Quality Without Extending the Budget
&lt;/h2&gt;

&lt;p&gt;After reverting the longer search budget, the engineering approach shifted toward improving the usefulness of the paths discovered within the existing constraints.&lt;/p&gt;

&lt;p&gt;Three mechanisms were particularly relevant.&lt;/p&gt;

&lt;h3&gt;
  
  
  10.1 Goal-directed edge ordering
&lt;/h3&gt;

&lt;p&gt;Outgoing connections were ordered to prioritize promising progress toward the destination.&lt;/p&gt;

&lt;p&gt;Because bounded search terminates before exploring the complete graph, discovery order affects the quality of the candidate set.&lt;/p&gt;

&lt;p&gt;Exploring promising paths earlier can improve the available results without increasing the permitted execution time.&lt;/p&gt;

&lt;p&gt;This is not equivalent to A* optimality guarantees.&lt;/p&gt;

&lt;p&gt;The ordering is heuristic and does not establish that the globally best itinerary will be discovered.&lt;/p&gt;

&lt;h3&gt;
  
  
  10.2 Reverse reachability and remaining-leg lower bounds
&lt;/h3&gt;

&lt;p&gt;The engine used reverse-graph information to estimate the minimum number of remaining traveler-visible legs required to reach the destination.&lt;/p&gt;

&lt;p&gt;If a partial path could not satisfy the remaining transfer budget, its branch was rejected.&lt;/p&gt;

&lt;p&gt;A simplified condition is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;legs_used
  + minimum_remaining_legs
  &amp;gt; maximum_allowed_legs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This avoids spending computation on branches that cannot produce an admissible itinerary under the leg constraint.&lt;/p&gt;

&lt;h3&gt;
  
  
  10.3 Nearby-hub pruning
&lt;/h3&gt;

&lt;p&gt;Travel to airportless destinations often requires a nearby airport followed by a ground connection.&lt;/p&gt;

&lt;p&gt;However, indiscriminately exploring nearby transportation hubs creates many implausible combinations.&lt;/p&gt;

&lt;p&gt;The search therefore applied geographic-progress constraints and bounded airport-access or final-ground-leg rules.&lt;/p&gt;

&lt;p&gt;These restrictions reduced unnecessary exploration while retaining common multimodal journey structures.&lt;/p&gt;

&lt;p&gt;Together, the mechanisms improved candidate discovery efficiency without simply allocating more wall-clock time to every request.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. PostgreSQL Queue Semantics and Their Limits
&lt;/h2&gt;

&lt;p&gt;The incident also exposed an important difference between durable queue management and computation capacity.&lt;/p&gt;

&lt;p&gt;PostgreSQL offered useful coordination mechanisms.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;FOR UPDATE SKIP LOCKED&lt;/code&gt; allowed work claims to avoid waiting on rows already locked by another transaction.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;LISTEN/NOTIFY&lt;/code&gt; provided a way for a worker to receive notifications that new work was available.&lt;/p&gt;

&lt;p&gt;These primitives are well suited to the operational needs of a compact, database-backed work queue.&lt;/p&gt;

&lt;p&gt;However, neither mechanism increases the CPU capacity of the application executing the claimed work.&lt;/p&gt;

&lt;p&gt;Queue durability ensures that computation requests remain represented in persistent state.&lt;/p&gt;

&lt;p&gt;It does not ensure that the worker has sufficient processing resources to complete them within an interactive time budget.&lt;/p&gt;

&lt;p&gt;The same distinction applies to increasing the number of logical concurrency slots.&lt;/p&gt;

&lt;p&gt;If the bottleneck is synchronous JavaScript execution on one event loop, additional slots cannot independently execute additional CPU-bound graph traversals.&lt;/p&gt;

&lt;p&gt;The appropriate architectural extension would involve worker threads or separate computation processes, combined with explicit resource and provider-quota management.&lt;/p&gt;

&lt;p&gt;Such parallel execution was identified as future work in the evaluated technical report.&lt;/p&gt;

&lt;p&gt;The August 2026 pilot did not establish the capacity or performance of a horizontally replicated worker fleet.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. What a More Rigorous Evaluation Would Require
&lt;/h2&gt;

&lt;p&gt;The incident was diagnosed using operational observations.&lt;/p&gt;

&lt;p&gt;It was not a controlled queueing experiment.&lt;/p&gt;

&lt;p&gt;The technical report did not establish the exact effective arrival rate, service-time distribution, or utilization parameter required to fit a predictive queueing model.&lt;/p&gt;

&lt;p&gt;It would therefore be inappropriate to calculate an observed Routavio utilization ratio or assert a specific saturation threshold.&lt;/p&gt;

&lt;p&gt;A future controlled evaluation should collect at least the following measurements:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Engineering purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Request arrival rate&lt;/td&gt;
&lt;td&gt;Quantify incoming search demand&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Queue waiting time&lt;/td&gt;
&lt;td&gt;Separate scheduling delay from computation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Computation service time&lt;/td&gt;
&lt;td&gt;Characterize resource occupancy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service-time percentiles&lt;/td&gt;
&lt;td&gt;Identify long-running search behavior&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Queue depth over time&lt;/td&gt;
&lt;td&gt;Detect sustained backlog growth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worker CPU utilization&lt;/td&gt;
&lt;td&gt;Identify CPU-bound bottlenecks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Event-loop delay&lt;/td&gt;
&lt;td&gt;Measure scheduling interference&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Itinerary quality&lt;/td&gt;
&lt;td&gt;Quantify the value of additional search&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Completed requests per second&lt;/td&gt;
&lt;td&gt;Estimate realized processing capacity&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;An isolated evaluation should also compare multiple search-budget configurations under equivalent workloads.&lt;/p&gt;

&lt;p&gt;This would allow the engineering team to estimate whether quality improvements justify their operational cost.&lt;/p&gt;

&lt;p&gt;The distinction between controlled experiments and observations of a live pilot system is important.&lt;/p&gt;

&lt;p&gt;The published measurements establish that the longer budget improved the observed isolated search and that the deployed change produced queue starvation.&lt;/p&gt;

&lt;p&gt;They do not establish a general numerical relationship between route quality, arrival rate, and queueing delay across all workloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  13. Implications for Travel Planner Architecture
&lt;/h2&gt;

&lt;p&gt;The findings have several consequences for the design of route optimization services.&lt;/p&gt;

&lt;p&gt;First, a search budget is not solely an algorithmic parameter.&lt;/p&gt;

&lt;p&gt;In a shared service, it also influences job service time and therefore effective system capacity.&lt;/p&gt;

&lt;p&gt;Second, optimizing route quality for one difficult origin-destination pair can harm unrelated users when computation resources are shared.&lt;/p&gt;

&lt;p&gt;Third, queueing behavior should be evaluated before extending worst-case execution limits.&lt;/p&gt;

&lt;p&gt;Fourth, logical concurrency must be distinguished from actual CPU parallelism.&lt;/p&gt;

&lt;p&gt;Finally, route optimization should be assessed in terms of useful completed results rather than candidate quality alone.&lt;/p&gt;

&lt;p&gt;These considerations are particularly important for multimodal travel planners because different origin-destination pairs can have substantially different computational characteristics.&lt;/p&gt;

&lt;p&gt;A direct flight corridor and an airportless destination requiring several transportation modes may impose very different search workloads.&lt;/p&gt;

&lt;p&gt;Treating them as identical computational jobs can therefore create undesirable resource allocation behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The Routavio incident demonstrated that an algorithmic improvement can be correct when measured locally and harmful when deployed globally.&lt;/p&gt;

&lt;p&gt;Increasing the bounded search budget improved candidate discovery for a difficult multimodal route.&lt;/p&gt;

&lt;p&gt;But the additional service time prevented the shared worker from processing other requests efficiently.&lt;/p&gt;

&lt;p&gt;The resulting queue starvation made the overall travel planning experience worse.&lt;/p&gt;

&lt;p&gt;The successful response was not to allocate progressively more computation time.&lt;/p&gt;

&lt;p&gt;It was to improve search ordering, reverse reachability, and geographic pruning while preserving the service-time budget.&lt;/p&gt;

&lt;p&gt;Queueing theory provides a useful framework for interpreting this outcome.&lt;/p&gt;

&lt;p&gt;In interactive route optimization, computation quality cannot be separated from the capacity and latency of the system delivering it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A route optimization engine must optimize not only which journeys it discovers, but also the computational resources required to deliver those journeys to users.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Related Research
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://dev.to/routavio/engineering-a-multimodal-travel-planner-on-a-228060-edge-graph-4i0d"&gt;Engineering a Multimodal Travel Planner on a 228,060-Edge Graph&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;[1] Martins, E. Q. V. (1984). On a multicriteria shortest path problem. &lt;em&gt;European Journal of Operational Research&lt;/em&gt;, 16(2), 236–245. &lt;a href="https://doi.org/10.1016/0377-2217(84)90077-8" rel="noopener noreferrer"&gt;https://doi.org/10.1016/0377-2217(84)90077-8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] Little, J. D. C. (1961). A Proof for the Queuing Formula: L = λW. &lt;em&gt;Operations Research&lt;/em&gt;, 9(3), 383–387. &lt;a href="https://doi.org/10.1287/opre.9.3.383" rel="noopener noreferrer"&gt;https://doi.org/10.1287/opre.9.3.383&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] Kingman, J. F. C. (1961). The Single Server Queue in Heavy Traffic. &lt;em&gt;Mathematical Proceedings of the Cambridge Philosophical Society&lt;/em&gt;, 57(4), 902–904. &lt;a href="https://doi.org/10.1017/S0305004100036094" rel="noopener noreferrer"&gt;https://doi.org/10.1017/S0305004100036094&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[4] Kleppmann, M. (2017). &lt;em&gt;Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems&lt;/em&gt;. O'Reilly Media.&lt;/p&gt;

&lt;p&gt;[5] Harchol-Balter, M. (2013). &lt;em&gt;Performance Modeling and Design of Computer Systems: Queueing Theory in Action&lt;/em&gt;. Cambridge University Press.&lt;/p&gt;

&lt;p&gt;[6] PostgreSQL Global Development Group. (2026). &lt;em&gt;PostgreSQL 18 Documentation: SELECT&lt;/em&gt;. &lt;a href="https://www.postgresql.org/docs/18/sql-select.html" rel="noopener noreferrer"&gt;https://www.postgresql.org/docs/18/sql-select.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[7] PostgreSQL Global Development Group. (2026). &lt;em&gt;PostgreSQL 18 Documentation: LISTEN and NOTIFY&lt;/em&gt;. &lt;a href="https://www.postgresql.org/docs/18/sql-listen.html" rel="noopener noreferrer"&gt;https://www.postgresql.org/docs/18/sql-listen.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[8] Çınar, H. (2026). &lt;em&gt;Design and Implementation of a Multimodal Door-to-Door Travel Metasearch Platform with a Bounded Graph-Based Route Computation Engine and an Observability-Driven Deployment Pipeline&lt;/em&gt;. Sabancı University. Public technical edition, repository revision &lt;code&gt;71e8cd39&lt;/code&gt;, Sections 5.1.2–5.1.4, 6.2.4, 7.1.4, and 7.2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project:&lt;/strong&gt; &lt;a href="https://www.routavio.com" rel="noopener noreferrer"&gt;Routavio | Multimodal Route Optimization and Travel Planning&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The reported route-discovery measurements and incident observations refer to Routavio's August 2026 pilot environment. Queueing models and illustrative calculations are theoretical explanations, not measured production benchmarks.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>performance</category>
      <category>postgres</category>
      <category>architecture</category>
    </item>
    <item>
      <title>A 24.6x Latency Gap That Had Almost Nothing to Do With Graph Search Copy</title>
      <dc:creator>Halil Cinar</dc:creator>
      <pubDate>Sat, 17 Oct 2026 13:34:14 +0000</pubDate>
      <link>https://dev.to/routavio/a-246x-latency-gap-that-had-almost-nothing-to-do-with-graph-search-copy-2h7b</link>
      <guid>https://dev.to/routavio/a-246x-latency-gap-that-had-almost-nothing-to-do-with-graph-search-copy-2h7b</guid>
      <description>&lt;p&gt;During the performance evaluation of &lt;a href="https://www.routavio.com" rel="noopener noreferrer"&gt;Routavio&lt;/a&gt;, a multimodal travel planning and route optimization platform, we encountered an unexpected latency pattern.&lt;/p&gt;

&lt;p&gt;The same route computation engine sometimes completed its first search pass in less than one second, while other executions required more than twenty seconds.&lt;/p&gt;

&lt;p&gt;The transportation graph contained 24,774 nodes and 228,060 directed edges. It represented flight, rail, coach, and ferry connections obtained from heterogeneous transportation data sources.&lt;/p&gt;

&lt;p&gt;Given the computational characteristics of graph traversal, our initial investigation focused on the routing algorithm.&lt;/p&gt;

&lt;p&gt;However, the evidence eventually showed that the dominant latency component was not graph search.&lt;/p&gt;

&lt;p&gt;It was graph loading.&lt;/p&gt;

&lt;p&gt;This article presents the performance investigation, the experimental evidence that distinguished competing explanations, and the architectural modifications introduced to address the problem.&lt;/p&gt;

&lt;p&gt;The measurements refer to Routavio's August 2026 pilot implementation, evaluated at repository revision &lt;code&gt;71e8cd39&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Computational Context
&lt;/h2&gt;

&lt;p&gt;Routavio represents transportation supply as a directed, time-aware graph.&lt;/p&gt;

&lt;p&gt;Nodes correspond to locations such as airports, railway stations, coach terminals, and city anchors.&lt;/p&gt;

&lt;p&gt;Edges represent transportation connections with attributes including mode, duration, provider, price evidence, and schedule information.&lt;/p&gt;

&lt;p&gt;The routing engine performs a budget-bounded, heuristically pruned depth-first search over this network.&lt;/p&gt;

&lt;p&gt;Unlike conventional shortest-path implementations operating on a complete static graph, the engine must accommodate incomplete transportation data and connections acquired during search.&lt;/p&gt;

&lt;p&gt;The relevant computation pipeline can be summarized as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Computation Request
        |
        v
Graph Loading / Cache Lookup
        |
        v
On-Demand Transport Data Acquisition
        |
        v
Nearby Airport and Station Expansion
        |
        v
Bounded Graph Search
        |
        v
Connection Feasibility Validation
        |
        v
Multicriteria Ranking
        |
        v
Itinerary Persistence
        |
        v
Search Result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The implementation uses PostgreSQL to persist transportation segments and computation state.&lt;/p&gt;

&lt;p&gt;An in-memory adjacency structure is constructed from the relational transport data and reused by the worker process.&lt;/p&gt;

&lt;p&gt;This architecture avoids introducing a separate graph database, but it introduces a potentially expensive graph materialization stage.&lt;/p&gt;

&lt;p&gt;The original performance investigation did not initially distinguish this stage sufficiently from graph traversal.&lt;/p&gt;

&lt;p&gt;That distinction became central to explaining the latency variation.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Formulating Competing Hypotheses
&lt;/h2&gt;

&lt;p&gt;The performance anomaly was initially attributed to three possible causes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hypothesis H1: Algorithmic regression
&lt;/h3&gt;

&lt;p&gt;A recent change to search heuristics might have increased graph traversal work or altered pruning effectiveness.&lt;/p&gt;

&lt;p&gt;If this hypothesis were correct, slower searches would be expected to traverse substantially more edges, expand more nodes, or exhibit less effective pruning.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hypothesis H2: Growth of the search space
&lt;/h3&gt;

&lt;p&gt;The transportation graph could have become computationally more expensive as new segments were imported.&lt;/p&gt;

&lt;p&gt;An increase in graph density or the number of eligible connections might produce greater traversal costs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hypothesis H3: Worker resource contention
&lt;/h3&gt;

&lt;p&gt;The Node.js worker processed route computations through multiple logical execution slots.&lt;/p&gt;

&lt;p&gt;Because graph traversal was synchronous JavaScript, these slots shared a single event loop.&lt;/p&gt;

&lt;p&gt;Resource contention or event-loop blocking could therefore affect response latency.&lt;/p&gt;

&lt;p&gt;All three explanations were technically plausible.&lt;/p&gt;

&lt;p&gt;However, selecting the most plausible explanation is not equivalent to identifying the actual cause.&lt;/p&gt;

&lt;p&gt;As Jain (1991) discusses in the context of computer systems performance analysis, meaningful evaluation depends on workload characterization, measurement selection, and the distinction between observed behavior and causal interpretation [1].&lt;/p&gt;

&lt;p&gt;We therefore introduced measurements designed to distinguish these competing hypotheses.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Stratifying Latency by Cache State
&lt;/h2&gt;

&lt;p&gt;The decisive observation was that slow executions correlated with the amount of time elapsed since the previous computation.&lt;/p&gt;

&lt;p&gt;The graph adjacency structure was cached inside the worker process with a time-to-live.&lt;/p&gt;

&lt;p&gt;This meant that the next search could encounter either a warm graph or an expired cache requiring reconstruction.&lt;/p&gt;

&lt;p&gt;We grouped first-pass latency measurements by the elapsed time since the previous computation.&lt;/p&gt;

&lt;p&gt;The August 2026 pilot measurements produced the following results.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time since previous computation&lt;/th&gt;
&lt;th&gt;Samples&lt;/th&gt;
&lt;th&gt;Median pass-1 latency&lt;/th&gt;
&lt;th&gt;Share above 10 seconds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Less than 5 minutes&lt;/td&gt;
&lt;td&gt;4,252&lt;/td&gt;
&lt;td&gt;927 ms&lt;/td&gt;
&lt;td&gt;12%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5 to 30 minutes&lt;/td&gt;
&lt;td&gt;275&lt;/td&gt;
&lt;td&gt;1,898 ms&lt;/td&gt;
&lt;td&gt;36%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;More than 30 minutes&lt;/td&gt;
&lt;td&gt;99&lt;/td&gt;
&lt;td&gt;22,838 ms&lt;/td&gt;
&lt;td&gt;69%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The difference between the warm-cache and cold-cache medians was approximately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cold / Warm Median Ratio

22,838 ms / 927 ms = 24.6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result revealed an important relationship between cache lifecycle state and first-pass execution time.&lt;/p&gt;

&lt;p&gt;A request arriving shortly after a previous computation generally benefited from a resident graph.&lt;/p&gt;

&lt;p&gt;A request arriving after cache expiration could incur the cost of rebuilding the complete adjacency structure.&lt;/p&gt;

&lt;p&gt;However, this observation alone was not sufficient to prove the precise cause.&lt;/p&gt;

&lt;p&gt;A change in request frequency might coincide with other factors, including provider latency, background jobs, or route complexity.&lt;/p&gt;

&lt;p&gt;Further instrumentation was necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Separating Graph Loading from Search Execution
&lt;/h2&gt;

&lt;p&gt;The next step was to inspect the work performed by representative slow and fast computations.&lt;/p&gt;

&lt;p&gt;The pilot telemetry recorded the following counters:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Measurement&lt;/th&gt;
&lt;th&gt;Slow run&lt;/th&gt;
&lt;th&gt;Fast run&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Edges traversed&lt;/td&gt;
&lt;td&gt;4.65 million&lt;/td&gt;
&lt;td&gt;4.03 million&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nodes expanded&lt;/td&gt;
&lt;td&gt;50,000&lt;/td&gt;
&lt;td&gt;46,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prune ratio&lt;/td&gt;
&lt;td&gt;98.9%&lt;/td&gt;
&lt;td&gt;98.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Paths discovered&lt;/td&gt;
&lt;td&gt;206&lt;/td&gt;
&lt;td&gt;220&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Event-loop lag, p95&lt;/td&gt;
&lt;td&gt;23 ms&lt;/td&gt;
&lt;td&gt;34 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Graph loading time&lt;/td&gt;
&lt;td&gt;21,539 ms&lt;/td&gt;
&lt;td&gt;Approximately 0 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These measurements were particularly informative.&lt;/p&gt;

&lt;p&gt;The slow computation traversed somewhat more edges and expanded somewhat more nodes, but the difference in traversal work was insufficient to explain a latency gap exceeding twenty seconds.&lt;/p&gt;

&lt;p&gt;Both runs exhibited the same reported pruning ratio.&lt;/p&gt;

&lt;p&gt;The event-loop lag measurements did not support the hypothesis that increased event-loop contention was responsible for the large difference.&lt;/p&gt;

&lt;p&gt;Instead, nearly the entire additional delay was concentrated in graph loading.&lt;/p&gt;

&lt;p&gt;The analysis therefore shifted from algorithmic complexity to cache lifecycle behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Latency Decomposition as a Diagnostic Method
&lt;/h2&gt;

&lt;p&gt;A useful conceptual model separates the first computation pass into several components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;T_pass1 =
    T_graph_load
  + T_graph_search
  + T_validation
  + T_other
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a conceptual decomposition rather than a claim that every component was independently measured with identical precision.&lt;/p&gt;

&lt;p&gt;The distinction matters because a metric named &lt;code&gt;search_duration&lt;/code&gt; can be misleading if it includes database acquisition, graph construction, and actual traversal.&lt;/p&gt;

&lt;p&gt;In Routavio's investigation, the performance problem was initially examined as a search regression because the recorded phase timer did not make the graph-loading contribution sufficiently visible.&lt;/p&gt;

&lt;p&gt;Separating the graph-loading term provided the evidence needed to reject the earlier explanations.&lt;/p&gt;

&lt;p&gt;The case illustrates a broader methodological problem in performance engineering.&lt;/p&gt;

&lt;p&gt;An aggregate latency measurement identifies the existence of a delay, but not necessarily the subsystem responsible for it.&lt;/p&gt;

&lt;p&gt;Useful instrumentation should distinguish between competing causal explanations rather than simply confirming that an operation was slow.&lt;/p&gt;

&lt;p&gt;This principle is consistent with the experimental methodology developed in Jain's &lt;em&gt;The Art of Computer Systems Performance Analysis&lt;/em&gt; [1].&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Why Graph Cache Lifecycle Matters
&lt;/h2&gt;

&lt;p&gt;The adjacency structure was maintained as a process-local cache.&lt;/p&gt;

&lt;p&gt;Transportation segments were stored in PostgreSQL, and the worker materialized the graph in memory when required.&lt;/p&gt;

&lt;p&gt;This arrangement provided several architectural advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relational storage supported reporting, auditing, and data integrity.&lt;/li&gt;
&lt;li&gt;Graph traversal operated on an in-memory representation.&lt;/li&gt;
&lt;li&gt;A dedicated graph database was unnecessary.&lt;/li&gt;
&lt;li&gt;The system avoided additional stateful infrastructure components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, the approach also created a substantial cold-loading cost.&lt;/p&gt;

&lt;p&gt;The relevant distinction was not simply between cached and uncached data.&lt;/p&gt;

&lt;p&gt;It was between a graph that remained resident inside the correct process and a graph that required reconstruction before an interactive computation could proceed.&lt;/p&gt;

&lt;p&gt;A scheduled operation running in a different process could not warm the worker's module-scoped graph cache.&lt;/p&gt;

&lt;p&gt;The cached object belonged to the worker's runtime.&lt;/p&gt;

&lt;p&gt;This type of locality problem has conceptual connections to Denning's working-set model [2].&lt;/p&gt;

&lt;p&gt;Denning's original work concerned virtual memory and program locality rather than application-level transportation graph caches. Nevertheless, the general principle that frequently required data should remain accessible within an appropriate memory residency policy is relevant.&lt;/p&gt;

&lt;p&gt;For Routavio, the problem was especially visible because transportation graph materialization had a much higher cost than reusing an existing adjacency structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Correcting the Cache Lifecycle
&lt;/h2&gt;

&lt;p&gt;The selected corrective approach consisted of two mechanisms.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.1 Refresh-ahead
&lt;/h3&gt;

&lt;p&gt;Rather than waiting for cache expiration to force an interactive request to rebuild the graph, the worker refreshes the graph ahead of expiry.&lt;/p&gt;

&lt;p&gt;The existing cached representation remains available while the refresh operation is performed.&lt;/p&gt;

&lt;p&gt;This approach reduces the probability that a user-facing computation encounters an expensive cold path.&lt;/p&gt;

&lt;p&gt;It does not eliminate the underlying cost of graph construction.&lt;/p&gt;

&lt;p&gt;Instead, it changes when that cost is incurred.&lt;/p&gt;

&lt;p&gt;This distinction is important when interpreting a performance improvement.&lt;/p&gt;

&lt;p&gt;Reducing user-visible latency is not necessarily equivalent to reducing the total computational work performed by the system.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 Cache warming during worker startup
&lt;/h3&gt;

&lt;p&gt;A second mechanism warms the graph cache when the worker process starts.&lt;/p&gt;

&lt;p&gt;Without startup warming, the first request after deployment or process restart could become responsible for constructing the entire graph.&lt;/p&gt;

&lt;p&gt;With an explicit warm-up mechanism, graph initialization can occur before an interactive route computation requires the structure.&lt;/p&gt;

&lt;p&gt;The implementation therefore addresses two separate lifecycle events:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Routine cache expiration during operation.&lt;/li&gt;
&lt;li&gt;Process startup following deployment or restart.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both events previously risked exposing expensive graph loading to users.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Why Increasing the Cache TTL Was Not Sufficient
&lt;/h2&gt;

&lt;p&gt;Extending cache lifetime would appear to be the simplest response to the problem.&lt;/p&gt;

&lt;p&gt;If a longer TTL reduces cache misses, it should also reduce the frequency of expensive graph reconstruction.&lt;/p&gt;

&lt;p&gt;However, transportation supply is not static.&lt;/p&gt;

&lt;p&gt;Routavio periodically imports new transportation connections and acquires additional information from upstream providers.&lt;/p&gt;

&lt;p&gt;A graph retained for too long may exclude newly available routes.&lt;/p&gt;

&lt;p&gt;The application could continue operating without an exception while silently returning incomplete itinerary results.&lt;/p&gt;

&lt;p&gt;This creates a trade-off between computation latency and transportation-data freshness.&lt;/p&gt;

&lt;p&gt;Let &lt;code&gt;A(t)&lt;/code&gt; represent the age of the graph since its last successful refresh.&lt;/p&gt;

&lt;p&gt;Let &lt;code&gt;L(t)&lt;/code&gt; represent the time required to access or reconstruct the graph.&lt;/p&gt;

&lt;p&gt;A longer retention interval may reduce expected reconstruction frequency, but it can increase the age of the transportation data represented by the search.&lt;/p&gt;

&lt;p&gt;The relevant engineering objective is therefore not simply to minimize cache misses.&lt;/p&gt;

&lt;p&gt;It is to preserve an acceptable combination of response latency, data freshness, memory consumption, and itinerary quality.&lt;/p&gt;

&lt;p&gt;For Routavio, increasing the TTL alone was rejected in favor of refresh-ahead and startup warming.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Dynamic Edge Insertion and Memory Pressure
&lt;/h2&gt;

&lt;p&gt;The cache architecture also interacted with on-demand transportation data acquisition.&lt;/p&gt;

&lt;p&gt;During an active search, an upstream provider could introduce flight connections that were not present in the initial graph.&lt;/p&gt;

&lt;p&gt;These new edges needed to become visible to the ongoing computation.&lt;/p&gt;

&lt;p&gt;The direct implementation approach was to invalidate the graph cache and reload the entire structure.&lt;/p&gt;

&lt;p&gt;However, the old graph could still be referenced by an active computation.&lt;/p&gt;

&lt;p&gt;Reconstructing a second graph under these conditions temporarily increased memory consumption.&lt;/p&gt;

&lt;p&gt;In the pilot environment, this behavior caused worker crash loops.&lt;/p&gt;

&lt;p&gt;The implemented correction was incremental graph splicing.&lt;/p&gt;

&lt;p&gt;Newly persisted edges were incorporated into the existing cached adjacency structure, while stale entries for corresponding segment identifiers were replaced.&lt;/p&gt;

&lt;p&gt;This avoided constructing a second complete graph merely to introduce newly acquired transportation connections.&lt;/p&gt;

&lt;p&gt;The incident demonstrates why memory management must be considered alongside algorithmic complexity.&lt;/p&gt;

&lt;p&gt;An operation with acceptable theoretical computational complexity may still be unsuitable when its allocation behavior exceeds the limits of a constrained runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Interpreting the Results Through Tail Latency Research
&lt;/h2&gt;

&lt;p&gt;Dean and Barroso (2013) discuss the importance of latency variability in large-scale interactive systems [3].&lt;/p&gt;

&lt;p&gt;Their research emphasizes that average performance alone is insufficient when occasional slow operations can significantly affect user experience.&lt;/p&gt;

&lt;p&gt;Routavio's pilot represents a different scale and architecture, but the measurement problem is related.&lt;/p&gt;

&lt;p&gt;The overall latency distribution contained requests operating under different cache conditions.&lt;/p&gt;

&lt;p&gt;Aggregating these observations without separating the relevant runtime states obscured an important source of variability.&lt;/p&gt;

&lt;p&gt;The warm-cache median of 927 ms and the cold-cache median of 22,838 ms described substantially different operating regimes.&lt;/p&gt;

&lt;p&gt;These were not measurements of two competing route optimization algorithms.&lt;/p&gt;

&lt;p&gt;They were observations of the same system under different cache lifecycle conditions.&lt;/p&gt;

&lt;p&gt;This distinction changes the interpretation of the result.&lt;/p&gt;

&lt;p&gt;It would be incorrect to claim that Routavio's graph search algorithm became 24.6 times faster.&lt;/p&gt;

&lt;p&gt;The evidence instead indicates that &lt;strong&gt;cold graph loading was responsible for a major component of first-pass latency variation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The corrective mechanisms were designed to remove that expensive cold path from the normal user-facing experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Experimental Limitations
&lt;/h2&gt;

&lt;p&gt;The investigation was conducted in a deployed pilot environment rather than under fully isolated laboratory conditions.&lt;/p&gt;

&lt;p&gt;Measurements were recorded on 26 and 27 August 2026, using a single-host environment running application containers, PostgreSQL, background computation, and observability components.&lt;/p&gt;

&lt;p&gt;Several limitations must be acknowledged.&lt;/p&gt;

&lt;p&gt;First, the cache-state measurements were observational.&lt;/p&gt;

&lt;p&gt;Request characteristics, scheduled jobs, and upstream data acquisition were not fully controlled across groups.&lt;/p&gt;

&lt;p&gt;Second, the comparison between representative slow and fast runs supported the diagnosis but did not constitute a randomized experiment.&lt;/p&gt;

&lt;p&gt;Third, the reported 24.6 ratio compared medians from different cache-state populations.&lt;/p&gt;

&lt;p&gt;It was not a directly measured universal speedup produced by a subsequent deployment.&lt;/p&gt;

&lt;p&gt;Fourth, the measured first-pass durations should not be confused with complete end-to-end user response times.&lt;/p&gt;

&lt;p&gt;A separate seven-day sample of 2,864 interactive computation runs reported a median time to provisional result publication of 7,284 ms. That metric covers a different operational boundary and should not be compared directly with the first-pass medians.&lt;/p&gt;

&lt;p&gt;Finally, the load-testing results did not establish the maximum capacity of the application.&lt;/p&gt;

&lt;p&gt;At ten virtual users, the CDN began rate-limiting the load generator before the origin application reached saturation.&lt;/p&gt;

&lt;p&gt;The actual application saturation point remained unmeasured.&lt;/p&gt;

&lt;p&gt;These distinctions prevent performance measurements from being interpreted beyond the evidence available.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. Implications for Route Optimization Systems
&lt;/h2&gt;

&lt;p&gt;The investigation produced several practical conclusions for multimodal travel planning architectures.&lt;/p&gt;

&lt;h3&gt;
  
  
  12.1 Algorithmic optimization should follow latency attribution
&lt;/h3&gt;

&lt;p&gt;A complex graph search system may contain expensive operations outside traversal itself.&lt;/p&gt;

&lt;p&gt;Reducing path exploration is not necessarily useful if most user-visible latency originates from loading or constructing the graph.&lt;/p&gt;

&lt;h3&gt;
  
  
  12.2 Cache state should be treated as a measurement variable
&lt;/h3&gt;

&lt;p&gt;Latency samples collected under different cache states should be separated where the difference is operationally meaningful.&lt;/p&gt;

&lt;p&gt;Otherwise, changes in traffic frequency may appear to be changes in algorithm performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  12.3 Freshness and performance must be evaluated together
&lt;/h3&gt;

&lt;p&gt;Transportation data changes over time.&lt;/p&gt;

&lt;p&gt;An aggressive caching policy that improves response speed while hiding newly available routes may reduce the practical quality of the travel planner.&lt;/p&gt;

&lt;h3&gt;
  
  
  12.4 Process boundaries determine cache behavior
&lt;/h3&gt;

&lt;p&gt;A graph cached inside one worker process is not automatically available to another process.&lt;/p&gt;

&lt;p&gt;Cache warming and invalidation policies must respect the runtime topology of the application.&lt;/p&gt;

&lt;h3&gt;
  
  
  12.5 Dynamic updates require explicit memory management
&lt;/h3&gt;

&lt;p&gt;Reloading a complete graph after every on-demand data acquisition can introduce avoidable allocation pressure.&lt;/p&gt;

&lt;p&gt;Incremental updates may offer a more appropriate trade-off, provided graph consistency is maintained.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The most important optimization in this investigation was not a modification to the route search algorithm.&lt;/p&gt;

&lt;p&gt;It was identifying that the apparent search latency problem belonged primarily to graph-loading lifecycle management.&lt;/p&gt;

&lt;p&gt;Once graph construction and traversal were measured separately, previously plausible explanations could be rejected.&lt;/p&gt;

&lt;p&gt;The findings supported a revised cache architecture with refresh-ahead, worker startup warming, and incremental graph updates.&lt;/p&gt;

&lt;p&gt;More broadly, the investigation demonstrates that performance engineering requires a precise understanding of what a measurement includes.&lt;/p&gt;

&lt;p&gt;For multimodal route optimization systems, improving the quality of a pathfinding algorithm is only one part of delivering useful travel recommendations.&lt;/p&gt;

&lt;p&gt;The system must also make transportation data available to that algorithm within a predictable computational budget.&lt;/p&gt;

&lt;h3&gt;
  
  
  Previous Article
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://dev.to/routavio"&gt;Why Dijkstra Was Not Our Default for Multimodal Route Optimization&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Related Engineering Research
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://dev.to/routavio/engineering-a-multimodal-travel-planner-on-a-228060-edge-graph-4i0d"&gt;Engineering a Multimodal Travel Planner on a 228,060-Edge Graph&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;[1] Jain, R. (1991). &lt;em&gt;The Art of Computer Systems Performance Analysis: Techniques for Experimental Design, Measurement, Simulation, and Modeling&lt;/em&gt;. John Wiley &amp;amp; Sons. ISBN 978-0-471-50336-1. &lt;a href="https://www.cs.wustl.edu/%7Ejain/books/perfbook.htm" rel="noopener noreferrer"&gt;https://www.cs.wustl.edu/~jain/books/perfbook.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] Denning, P. J. (1968). The Working Set Model for Program Behavior. &lt;em&gt;Communications of the ACM&lt;/em&gt;, 11(5), 323–333. &lt;a href="https://doi.org/10.1145/363095.363141" rel="noopener noreferrer"&gt;https://doi.org/10.1145/363095.363141&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] Dean, J., &amp;amp; Barroso, L. A. (2013). The Tail at Scale. &lt;em&gt;Communications of the ACM&lt;/em&gt;, 56(2), 74–80. &lt;a href="https://doi.org/10.1145/2408776.2408794" rel="noopener noreferrer"&gt;https://doi.org/10.1145/2408776.2408794&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[4] Kleppmann, M. (2017). &lt;em&gt;Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems&lt;/em&gt;. O'Reilly Media.&lt;/p&gt;

&lt;p&gt;[5] Çınar, H. (2026). &lt;em&gt;Design and Implementation of a Multimodal Door-to-Door Travel Metasearch Platform with a Bounded Graph-Based Route Computation Engine and an Observability-Driven Deployment Pipeline&lt;/em&gt;. Sabancı University. Public technical edition, repository revision &lt;code&gt;71e8cd39&lt;/code&gt;, Sections 5.1.1, 5.1.4, 6.2.2–6.2.3, and 7.1.2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project:&lt;/strong&gt; &lt;a href="https://www.routavio.com" rel="noopener noreferrer"&gt;Routavio | Multimodal Travel Planner and Route Optimization&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;All reported measurements refer to the evaluated August 2026 pilot environment. They are historical observations rather than guarantees of current platform performance.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>performance</category>
      <category>caching</category>
      <category>node</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Why Dijkstra Was Not Our Default for Multimodal Route Optimization Copy</title>
      <dc:creator>Halil Cinar</dc:creator>
      <pubDate>Sat, 17 Oct 2026 13:29:22 +0000</pubDate>
      <link>https://dev.to/routavio/why-dijkstra-was-not-our-default-for-multimodal-route-optimization-copy-5hd8</link>
      <guid>https://dev.to/routavio/why-dijkstra-was-not-our-default-for-multimodal-route-optimization-copy-5hd8</guid>
      <description>&lt;p&gt;Dijkstra's algorithm is one of the foundational methods in graph theory. Given a graph with nonnegative edge weights, it computes shortest paths with well-established correctness guarantees. A* extends shortest-path search through heuristic guidance, while RAPTOR addresses the specialized requirements of timetable-based public transportation.&lt;/p&gt;

&lt;p&gt;These methods are natural candidates for a travel route optimization engine.&lt;/p&gt;

&lt;p&gt;However, the algorithmic problem changes considerably when the transportation network is incomplete, edges arrive during computation, and the objective is to return several practically useful journeys rather than a single minimum-cost path.&lt;/p&gt;

&lt;p&gt;While developing &lt;a href="https://www.routavio.com" rel="noopener noreferrer"&gt;Routavio&lt;/a&gt;, a multimodal travel planning and route optimization platform, we encountered precisely these conditions.&lt;/p&gt;

&lt;p&gt;This article examines the theoretical assumptions behind conventional routing algorithms, explains the bounded heuristic search architecture adopted in Routavio's evaluated pilot implementation, and discusses the resulting trade-offs in completeness, computational efficiency, and itinerary quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Classical Shortest-Path Formulation
&lt;/h2&gt;

&lt;p&gt;Consider a directed transportation graph:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;G = (V, E)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;V&lt;/code&gt; represents locations such as airports, railway stations, and transport terminals, while &lt;code&gt;E&lt;/code&gt; represents directed transportation connections.&lt;/p&gt;

&lt;p&gt;For a path &lt;code&gt;P&lt;/code&gt; consisting of edges &lt;code&gt;e1, e2, ..., ek&lt;/code&gt;, the classical shortest-path objective is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;minimize C(P) = sum(c(e))
               for every edge e in P
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function &lt;code&gt;c(e)&lt;/code&gt; assigns a nonnegative cost to each edge.&lt;/p&gt;

&lt;p&gt;Dijkstra's algorithm identifies a minimum-cost path under this formulation [1].&lt;/p&gt;

&lt;p&gt;When an admissible heuristic estimates the remaining cost to the destination, A* can guide search toward the target without sacrificing optimality under the appropriate assumptions [2].&lt;/p&gt;

&lt;p&gt;Both approaches are highly effective when the optimization objective is well-defined and the graph representation is sufficiently complete.&lt;/p&gt;

&lt;p&gt;Multimodal travel planning introduces additional complications.&lt;/p&gt;

&lt;p&gt;A traveler may simultaneously consider monetary cost, duration, number of transfers, transport preference, and connection reliability.&lt;/p&gt;

&lt;p&gt;These criteria are not always reducible to one universally meaningful scalar objective.&lt;/p&gt;

&lt;p&gt;Martins (1984) studied multicriteria shortest-path problems, demonstrating the relevance of nondominated solutions when competing objectives must be considered [3].&lt;/p&gt;

&lt;p&gt;For travel planning, this means that multiple itineraries may be reasonable recommendations even when their relative rankings depend on user preferences.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Difference Between Network Optimality and Journey Optimality
&lt;/h2&gt;

&lt;p&gt;An important assumption in classical graph optimization is that the graph represents the network being optimized.&lt;/p&gt;

&lt;p&gt;In travel technology, this assumption is often weakened by the data acquisition process.&lt;/p&gt;

&lt;p&gt;A transportation platform may receive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flight fares from commercial pricing APIs.&lt;/li&gt;
&lt;li&gt;Scheduled railway or coach connections from GTFS feeds.&lt;/li&gt;
&lt;li&gt;Route availability from operator catalogues.&lt;/li&gt;
&lt;li&gt;Historical price observations without confirmed current inventory.&lt;/li&gt;
&lt;li&gt;Date-specific connections discovered during an active search.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These sources differ in temporal granularity, completeness, freshness, and reliability.&lt;/p&gt;

&lt;p&gt;As a result, a transportation graph is not necessarily a complete representation of every real-world travel option.&lt;/p&gt;

&lt;p&gt;An algorithm may compute the optimal path within the represented graph while omitting an objectively better journey whose connections were unavailable to the system.&lt;/p&gt;

&lt;p&gt;Formally, let:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;G_observed = (V_observed, E_observed)
G_actual   = (V_actual, E_actual)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the observed network is incomplete, an optimal path in &lt;code&gt;G_observed&lt;/code&gt; does not necessarily correspond to an optimal path in &lt;code&gt;G_actual&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This does not invalidate Dijkstra or A*.&lt;/p&gt;

&lt;p&gt;It limits the scope of the optimality claim.&lt;/p&gt;

&lt;p&gt;For Routavio, this distinction was central to the engineering problem.&lt;/p&gt;

&lt;p&gt;At the evaluated August 2026 repository revision, the transportation graph contained &lt;strong&gt;24,774 nodes and 228,060 directed edges&lt;/strong&gt;, assembled from heterogeneous transportation data.&lt;/p&gt;

&lt;p&gt;The objective was not to prove optimality over a complete European transportation network.&lt;/p&gt;

&lt;p&gt;It was to discover a limited set of plausible, structurally distinct itineraries using the information available within an interactive computation budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why RAPTOR Was Also Considered
&lt;/h2&gt;

&lt;p&gt;RAPTOR, or Round-Based Public Transit Routing, was introduced by Delling, Pajor, and Werneck as a routing approach designed specifically for scheduled public transportation [4].&lt;/p&gt;

&lt;p&gt;Rather than applying conventional graph traversal through a priority queue, RAPTOR processes public transit routes in rounds.&lt;/p&gt;

&lt;p&gt;This structure supports criteria such as earliest arrival time and number of transfers.&lt;/p&gt;

&lt;p&gt;It is particularly relevant for transportation systems where timetable information is sufficiently available and consistent.&lt;/p&gt;

&lt;p&gt;However, Routavio's data environment differed in several respects.&lt;/p&gt;

&lt;p&gt;Some transport connections were represented by exact scheduled departures. Others were represented by observed fares, approximate durations, or published corridor information.&lt;/p&gt;

&lt;p&gt;Furthermore, flight-pricing responses could introduce previously unavailable connections during the computation.&lt;/p&gt;

&lt;p&gt;RAPTOR remains a strong candidate for well-modeled timetable networks, but adopting it as the central method would not eliminate the problems associated with incomplete cross-modal supply, dynamically acquired flight segments, and heterogeneous fare evidence.&lt;/p&gt;

&lt;p&gt;The broader transportation routing literature, reviewed by Bast et al. (2016), provides useful context for understanding these distinctions [5].&lt;/p&gt;

&lt;p&gt;The question was therefore not which algorithm was universally superior.&lt;/p&gt;

&lt;p&gt;It was which computational strategy best matched our available data, expected outputs, and operational constraints.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Bounded Heuristic Depth-First Search
&lt;/h2&gt;

&lt;p&gt;Routavio's evaluated route computation engine used a budget-bounded, heuristically pruned depth-first traversal.&lt;/p&gt;

&lt;p&gt;The search maintained two principal termination constraints:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A wall-clock computation budget.&lt;/li&gt;
&lt;li&gt;A maximum number of completed candidate paths.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Traversal terminated when either limit was reached.&lt;/p&gt;

&lt;p&gt;The discovered candidate paths were subsequently subjected to validation, ranking, and diversity selection.&lt;/p&gt;

&lt;p&gt;The design deliberately separated path discovery from the final evaluation of itineraries.&lt;/p&gt;

&lt;p&gt;Conceptually, the search can be described as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INPUT:
    origin
    destination
    travel date
    transfer budget
    computation budget

INITIALIZE:
    candidate paths
    visited locations
    search deadline

SEARCH:
    expand outgoing connections

    reject invalid departure dates
    reject infeasible connections
    reject excessive geographic detours
    reject cycles and invalid route shapes

    prioritize promising destinations

    if destination reached:
        retain candidate

    stop at path or time budget

POSTPROCESS:
    validate complete itineraries
    rank by multiple criteria
    promote structural diversity

OUTPUT:
    bounded set of plausible itineraries
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pseudocode illustrates the computation strategy. It is not a verbatim reproduction of the production implementation.&lt;/p&gt;

&lt;p&gt;The central trade-off is straightforward.&lt;/p&gt;

&lt;p&gt;Restricting traversal reduces the amount of computation required, but it can also exclude feasible paths that a more exhaustive algorithm would discover.&lt;/p&gt;

&lt;p&gt;Consequently, the approach cannot claim global shortest-path optimality.&lt;/p&gt;

&lt;p&gt;Its effectiveness must instead be assessed through practical itinerary quality, feasibility, diversity, and computational cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Reverse-Graph Lower Bounds for Search Pruning
&lt;/h2&gt;

&lt;p&gt;One of the more useful mechanisms in Routavio's route engine was a lower bound on the minimum remaining number of traveler-visible legs.&lt;/p&gt;

&lt;p&gt;Consider a partial route that has already consumed &lt;code&gt;k&lt;/code&gt; legs.&lt;/p&gt;

&lt;p&gt;Let &lt;code&gt;h(v)&lt;/code&gt; denote an optimistic lower bound on the number of additional visible legs required to reach the destination from the current node &lt;code&gt;v&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If the user permits a maximum of &lt;code&gt;L&lt;/code&gt; visible legs, a branch can be rejected whenever:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k + h(v) &amp;gt; L
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Routavio estimated this lower bound using a 0-1 breadth-first computation over reverse adjacency.&lt;/p&gt;

&lt;p&gt;This matters because some local connectors do not consume the same traveler-visible leg budget as an intercity connection.&lt;/p&gt;

&lt;p&gt;The reverse search assigns the appropriate zero or one cost to each connection category when calculating the estimate.&lt;/p&gt;

&lt;p&gt;Unlike purely heuristic geographic pruning, this lower-bound check has a specific correctness property.&lt;/p&gt;

&lt;p&gt;Provided that &lt;code&gt;h(v)&lt;/code&gt; does not overestimate the minimum required remaining legs, the search does not discard a route that could satisfy the leg-count limit solely because of this check.&lt;/p&gt;

&lt;p&gt;This is an important distinction between &lt;strong&gt;safe constraint-based pruning&lt;/strong&gt; and &lt;strong&gt;heuristic pruning that deliberately sacrifices completeness&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Geographic Progress and the Airport Access Problem
&lt;/h2&gt;

&lt;p&gt;Geographic heuristics were introduced in response to actual routing defects.&lt;/p&gt;

&lt;p&gt;During development, a search from Istanbul to Colmar produced an itinerary involving geographically implausible coach movements through cities including Milan, Rome, Geneva, and Basel.&lt;/p&gt;

&lt;p&gt;The connections were individually represented in the graph, but the overall itinerary was not a sensible recommendation.&lt;/p&gt;

&lt;p&gt;The engine therefore introduced geographic-progress constraints to suppress excessive detours.&lt;/p&gt;

&lt;p&gt;However, a purely destination-oriented constraint creates another problem.&lt;/p&gt;

&lt;p&gt;Consider a traveler starting in Maastricht who needs to reach a distant destination by air.&lt;/p&gt;

&lt;p&gt;An appropriate journey may initially involve traveling to a larger airport in Düsseldorf or Cologne.&lt;/p&gt;

&lt;p&gt;That first ground connection may move away from the final destination or fail to produce immediate geographic progress.&lt;/p&gt;

&lt;p&gt;A strict progress heuristic could reject it.&lt;/p&gt;

&lt;p&gt;Routavio therefore introduced a bounded origin-access exception, subject to constraints on access distance, endpoint type, and geographic direction.&lt;/p&gt;

&lt;p&gt;The purpose was to preserve reasonable access to nearby airports without allowing the search to return to unconstrained geographic exploration.&lt;/p&gt;

&lt;p&gt;This illustrates a recurring problem in applied heuristic optimization.&lt;/p&gt;

&lt;p&gt;A constraint that eliminates one class of invalid results can also eliminate legitimate solutions.&lt;/p&gt;

&lt;p&gt;The design task is to identify the structural distinction between the two cases and encode an appropriately limited exception.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Time-Dependent Connection Feasibility
&lt;/h2&gt;

&lt;p&gt;A multimodal itinerary is not valid simply because consecutive transport edges share a location.&lt;/p&gt;

&lt;p&gt;The timing of the connection matters.&lt;/p&gt;

&lt;p&gt;A simplified transfer feasibility requirement is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;departure(next_leg)
    &amp;gt;= arrival(previous_leg)
       + minimum_connection_time
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The minimum connection time depends on the type of transfer.&lt;/p&gt;

&lt;p&gt;Changing trains within one station is different from transferring between an airport and a railway terminal in another part of the city.&lt;/p&gt;

&lt;p&gt;Routavio therefore used mode-aware minimum connection times and transfer feasibility evaluations.&lt;/p&gt;

&lt;p&gt;The route engine also considered date scope, excessive waiting, negative prices, invalid durations, and total itinerary duration.&lt;/p&gt;

&lt;p&gt;A key distinction is that scheduled connectivity does not imply guaranteed inventory.&lt;/p&gt;

&lt;p&gt;GTFS provides standardized structures for public transport schedules [6]. It does not, by itself, guarantee that a ticket remains available for purchase at a particular price.&lt;/p&gt;

&lt;p&gt;Preserving this distinction is essential when integrating planning data with commercial travel inventory.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Dynamic Graph Updates During Search
&lt;/h2&gt;

&lt;p&gt;Another constraint involved how new transportation edges entered the graph.&lt;/p&gt;

&lt;p&gt;Some flight connections were acquired on demand.&lt;/p&gt;

&lt;p&gt;The initial approach invalidated the cached graph and attempted a complete reload when new flight information became available.&lt;/p&gt;

&lt;p&gt;This created a resource problem.&lt;/p&gt;

&lt;p&gt;While an existing computation retained references to the old graph, the reload could construct a second full graph in memory.&lt;/p&gt;

&lt;p&gt;In the pilot environment, the resulting memory pressure caused worker failures.&lt;/p&gt;

&lt;p&gt;The implementation was changed to incrementally splice newly persisted flight edges into the existing adjacency representation, replacing stale entries with matching segment identifiers.&lt;/p&gt;

&lt;p&gt;This reduced the need to reconstruct the full transportation graph after each acquisition.&lt;/p&gt;

&lt;p&gt;It also demonstrated how algorithm design and runtime architecture interact.&lt;/p&gt;

&lt;p&gt;An operation that appears inexpensive in abstract graph theory may carry substantial memory and lifecycle costs in a production service.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Multicriteria Ranking and Route Diversity
&lt;/h2&gt;

&lt;p&gt;After candidate discovery and feasibility validation, Routavio ranked itineraries using multiple factors.&lt;/p&gt;

&lt;p&gt;These included monetary cost, duration, transfer count, and confidence derived from the source and freshness of transportation data.&lt;/p&gt;

&lt;p&gt;The ranking process also considered structural diversity.&lt;/p&gt;

&lt;p&gt;A result containing five nearly identical flight connections may offer less decision-making value than a smaller collection of genuinely different travel strategies.&lt;/p&gt;

&lt;p&gt;For example, a traveler may reasonably want to compare:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A faster air-plus-rail journey.&lt;/li&gt;
&lt;li&gt;A cheaper air-plus-coach combination.&lt;/li&gt;
&lt;li&gt;A ground-only itinerary with fewer travel modes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The relevant optimization objective is therefore not just to minimize one scalar value.&lt;/p&gt;

&lt;p&gt;It is to present useful alternatives across several dimensions.&lt;/p&gt;

&lt;p&gt;The approach relates to multicriteria optimization, but it does not enumerate the complete Pareto frontier.&lt;/p&gt;

&lt;p&gt;Because path discovery is bounded and heuristically pruned, the final ranking operates only over the candidates actually discovered.&lt;/p&gt;

&lt;p&gt;That qualification is necessary when interpreting the algorithm's output.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Limitations and Future Evaluation
&lt;/h2&gt;

&lt;p&gt;The evaluated implementation established that a bounded heuristic approach could produce plausible multimodal itineraries over heterogeneous transportation data.&lt;/p&gt;

&lt;p&gt;It did not establish that the selected search strategy was universally superior to Dijkstra, A*, RAPTOR, or other routing algorithms.&lt;/p&gt;

&lt;p&gt;A more rigorous comparative evaluation would require:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A labeled corpus of origin, destination, and departure-date combinations.&lt;/li&gt;
&lt;li&gt;Complete reference subgraphs for controlled algorithm comparisons.&lt;/li&gt;
&lt;li&gt;Independent validation of transfer feasibility and route quality.&lt;/li&gt;
&lt;li&gt;Measurements of recall relative to reference nondominated solutions.&lt;/li&gt;
&lt;li&gt;Controlled latency and resource-consumption benchmarks.&lt;/li&gt;
&lt;li&gt;Coverage and data-freshness measurements across transportation modes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Such an evaluation would help distinguish computational efficiency from route quality and data coverage.&lt;/p&gt;

&lt;p&gt;It would also support a more precise assessment of the circumstances under which heuristic search provides sufficient practical value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Classical shortest-path algorithms remain fundamental to transportation network optimization.&lt;/p&gt;

&lt;p&gt;Their guarantees are meaningful within their mathematical assumptions.&lt;/p&gt;

&lt;p&gt;Building a multimodal travel planner introduces additional operational constraints: incomplete supply, dynamic data acquisition, competing objectives, temporal feasibility, and limited computation budgets.&lt;/p&gt;

&lt;p&gt;Routavio's evaluated implementation used bounded heuristic search to address those constraints and retrieve plausible, diverse itineraries without claiming global optimality.&lt;/p&gt;

&lt;p&gt;The broader engineering lesson is that algorithm selection should begin with the structure and quality of the available data, the required output, and the operational environment.&lt;/p&gt;

&lt;p&gt;For real-world multimodal route planning, the most useful mathematical solution is not always the one obtained from the simplest abstraction of the network.&lt;/p&gt;

&lt;h3&gt;
  
  
  Related Engineering Article
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://dev.to/routavio/engineering-a-multimodal-travel-planner-on-a-228060-edge-graph-4i0d"&gt;Engineering a Multimodal Travel Planner on a 228,060-Edge Graph&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;[1] Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. &lt;em&gt;Numerische Mathematik&lt;/em&gt;, 1, 269–271. &lt;a href="https://doi.org/10.1007/BF01386390" rel="noopener noreferrer"&gt;https://doi.org/10.1007/BF01386390&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] Hart, P. E., Nilsson, N. J., &amp;amp; Raphael, B. (1968). A formal basis for the heuristic determination of minimum cost paths. &lt;em&gt;IEEE Transactions on Systems Science and Cybernetics&lt;/em&gt;, 4(2), 100–107. &lt;a href="https://doi.org/10.1109/TSSC.1968.300136" rel="noopener noreferrer"&gt;https://doi.org/10.1109/TSSC.1968.300136&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] Martins, E. Q. V. (1984). On a multicriteria shortest path problem. &lt;em&gt;European Journal of Operational Research&lt;/em&gt;, 16(2), 236–245. &lt;a href="https://doi.org/10.1016/0377-2217(84)90077-8" rel="noopener noreferrer"&gt;https://doi.org/10.1016/0377-2217(84)90077-8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[4] Delling, D., Pajor, T., &amp;amp; Werneck, R. F. (2015). Round-Based Public Transit Routing. &lt;em&gt;Transportation Science&lt;/em&gt;, 49(3), 591–604. &lt;a href="https://doi.org/10.1287/trsc.2014.0534" rel="noopener noreferrer"&gt;https://doi.org/10.1287/trsc.2014.0534&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[5] Bast, H., Delling, D., Goldberg, A., Müller-Hannemann, M., Pajor, T., Sanders, P., Wagner, D., &amp;amp; Werneck, R. F. (2016). Route Planning in Transportation Networks. In &lt;em&gt;Algorithm Engineering&lt;/em&gt;, Lecture Notes in Computer Science, 9220, 19–80. &lt;a href="https://doi.org/10.1007/978-3-319-49487-6_2" rel="noopener noreferrer"&gt;https://doi.org/10.1007/978-3-319-49487-6_2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[6] MobilityData. (2026). &lt;em&gt;GTFS Schedule Reference&lt;/em&gt;. &lt;a href="https://gtfs.org/documentation/schedule/reference/" rel="noopener noreferrer"&gt;https://gtfs.org/documentation/schedule/reference/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[7] Çınar, H. (2026). &lt;em&gt;Design and Implementation of a Multimodal Door-to-Door Travel Metasearch Platform with a Bounded Graph-Based Route Computation Engine and an Observability-Driven Deployment Pipeline&lt;/em&gt;. Sabancı University, public technical edition, repository revision 71e8cd39, Sections 2.1.5 and 5.1.1–5.1.4.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project:&lt;/strong&gt; &lt;a href="https://www.routavio.com" rel="noopener noreferrer"&gt;Routavio | Multimodal Travel Planner and Route Optimization&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Implementation details refer to the evaluated August 2026 pilot architecture. They should not be interpreted as guarantees about the current production system.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>optimization</category>
      <category>architecture</category>
      <category>travel</category>
    </item>
    <item>
      <title>Engineering a Multimodal Travel Planner on a 228,060-Edge Graph</title>
      <dc:creator>Halil Cinar</dc:creator>
      <pubDate>Sat, 17 Oct 2026 13:26:17 +0000</pubDate>
      <link>https://dev.to/routavio/engineering-a-multimodal-travel-planner-on-a-228060-edge-graph-4i0d</link>
      <guid>https://dev.to/routavio/engineering-a-multimodal-travel-planner-on-a-228060-edge-graph-4i0d</guid>
      <description>&lt;p&gt;A flight search engine answers a well-defined question: which available flights connect two airports? A door-to-door travel planner must answer a more difficult one: which sequence of flights, trains, coaches, and ferries can plausibly connect two places, even if the destination has no airport?&lt;/p&gt;

&lt;p&gt;I encountered that distinction while building &lt;a href="https://www.routavio.com" rel="noopener noreferrer"&gt;Routavio&lt;/a&gt;, a multimodal travel metasearch and route planning platform. This article documents the engineering approach evaluated in our August 2026 pilot system. It does not claim to introduce a new shortest-path algorithm. The contribution is the integration of incomplete transportation supply, bounded route optimization, explicit data provenance, and a deployable computation architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Problem Formulation
&lt;/h2&gt;

&lt;p&gt;Represent the transport network as a time-aware directed graph (G=(V,E)). Locations such as airports, railway stations, terminals, and city anchors are vertices; potential transport movements are edges. An edge can have a mode, duration, provider, departure information, price evidence, and a timestamp indicating when its information was verified.&lt;/p&gt;

&lt;p&gt;A conventional shortest-path problem might minimize a scalar cost (C(p)) over all feasible paths (p). A travel planner has competing objectives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Monetary cost&lt;/li&gt;
&lt;li&gt;Elapsed travel time&lt;/li&gt;
&lt;li&gt;Number of transfers&lt;/li&gt;
&lt;li&gt;Connection feasibility&lt;/li&gt;
&lt;li&gt;Confidence in price and schedule information&lt;/li&gt;
&lt;li&gt;Structural diversity among suggested itineraries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Martins (1984) established foundational results for multicriteria shortest-path problems, where competing objectives may produce multiple nondominated solutions. This is relevant to journey planning: a low-cost route with four risky transfers may be less attractive than a moderately more expensive journey with a single connection [1].&lt;/p&gt;

&lt;p&gt;Moreover, the supplied graph is incomplete. A timetable may provide known departures, while a flight-pricing API returns date-specific offers on demand. Some edges have price observations but no guaranteed seat inventory. The assumption that all feasible routes are already contained in a complete, static graph does not hold.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Pilot Network and Its Constraints
&lt;/h2&gt;

&lt;p&gt;At the evaluated repository revision, Routavio represented &lt;strong&gt;24,774 nodes and 228,060 directed transport edges&lt;/strong&gt;. The integration layer contained 17 heterogeneous source adapters or integrations. These included pricing interfaces, scheduled-data feeds, catalogues, and timetable services. Importantly, not every implemented integration was an active source of live inventory.&lt;/p&gt;

&lt;p&gt;The engineering problem was not finding just any sequence of connected edges. Early route discovery for Istanbul to Colmar, for example, produced a geographically implausible coach itinerary zig-zagging across European cities. Individual legs were graph-valid, but the itinerary was unsuitable for travelers.&lt;/p&gt;

&lt;p&gt;This motivated constraints covering geographic progress, maximum first-hop displacement, limited ground legs after flying, visited-node checks, and minimum connection times.&lt;/p&gt;

&lt;p&gt;A different defect arose when a small origin city needed a short journey to a nearby major airport. Pure destination-oriented pruning would have incorrectly rejected that initial access leg, so the design admitted a carefully bounded exception.&lt;/p&gt;

&lt;p&gt;These corrections illustrate a distinction in applied optimization. &lt;strong&gt;Network feasibility is necessary, but it is not sufficient for user-level plausibility.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why We Used Bounded Heuristic Search
&lt;/h2&gt;

&lt;p&gt;Dijkstra's algorithm and A* remain foundational methods for shortest-path search [2, 3]. Round-Based Public Transit Routing, or RAPTOR, addresses schedule-based public transportation with multiple criteria, notably arrival time and transfer count [4]. Bast et al. provide a comprehensive account of the algorithmic landscape for transportation network routing [5].&lt;/p&gt;

&lt;p&gt;We evaluated these approaches against a different operational objective. The pilot sought a &lt;strong&gt;small, structurally diverse set of plausible journeys within a strict time budget&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The graph was heterogeneous and could acquire new flight edges while a search was running.&lt;/p&gt;

&lt;p&gt;Routavio therefore used a budget-bounded, heuristically pruned depth-first search. It imposed both a wall-clock budget and a cap on completed candidate paths.&lt;/p&gt;

&lt;p&gt;Exploration order preferred edges progressing toward the destination, diversified outgoing connections across candidate hubs, and pruned branches that could not fit the remaining visible-leg budget.&lt;/p&gt;

&lt;p&gt;One lower bound used a reverse-graph 0-1 breadth-first computation to estimate the minimum remaining travel legs. That prune is sound relative to the leg budget.&lt;/p&gt;

&lt;p&gt;Other geometric and product-shape heuristics deliberately sacrifice completeness.&lt;/p&gt;

&lt;p&gt;Consequently, &lt;strong&gt;the engine does not guarantee the globally shortest, fastest, or cheapest real-world journey&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That limitation is part of the algorithm's specification, not a detail to conceal.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Separating Route Discovery from Ranking
&lt;/h2&gt;

&lt;p&gt;Graph traversal, ranking, and persistence were separate pipeline stages.&lt;/p&gt;

&lt;p&gt;Search produced candidate paths. Subsequent validation checked schedules, durations, transfers, and unrealistic sequences.&lt;/p&gt;

&lt;p&gt;Ranking then considered price, journey duration, transfer count, source confidence, and itinerary diversity.&lt;/p&gt;

&lt;p&gt;The diversity requirement is particularly important.&lt;/p&gt;

&lt;p&gt;Five minor variations of the same airport transfer may be less useful than alternatives with genuinely different travel patterns, such as air plus rail, air plus coach, or ground-only travel.&lt;/p&gt;

&lt;p&gt;This design follows the broader multiobjective-routing literature, while acknowledging that a bounded search cannot claim to enumerate the entire Pareto frontier.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The Compute System Is Part of the Optimization Problem
&lt;/h2&gt;

&lt;p&gt;The user-facing layer used Next.js, while a separate Node.js worker owned provider acquisition and CPU-heavy graph traversal.&lt;/p&gt;

&lt;p&gt;PostgreSQL carried durable computation requests. Work claims used &lt;code&gt;FOR UPDATE SKIP LOCKED&lt;/code&gt;, and &lt;code&gt;LISTEN/NOTIFY&lt;/code&gt; provided a wake-up signal.&lt;/p&gt;

&lt;p&gt;This architecture was intentionally compact.&lt;/p&gt;

&lt;p&gt;It also had a measurable limitation: four logical work slots shared a single JavaScript event loop for synchronous traversal.&lt;/p&gt;

&lt;p&gt;More logical slots did not produce more CPU parallelism.&lt;/p&gt;

&lt;p&gt;Search budgets, worker service time, and queue growth consequently became closely coupled.&lt;/p&gt;

&lt;p&gt;In one pilot incident, extending a difficult route search substantially improved the best discovered itinerary for that search while starving unrelated requests in the shared queue.&lt;/p&gt;

&lt;p&gt;The change was reverted.&lt;/p&gt;

&lt;p&gt;Better ordering and pruning were preferable to simply increasing every search's execution time.&lt;/p&gt;

&lt;p&gt;This illustrates a fundamental systems engineering principle: &lt;strong&gt;local improvements in computation quality must be evaluated against their effects on shared system capacity.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. What the Measurements Support
&lt;/h2&gt;

&lt;p&gt;The August 2026 evaluation reported a warm-cache median of &lt;strong&gt;927 ms&lt;/strong&gt; for the first search pass and a cold-cache median of &lt;strong&gt;22,838 ms&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The distinction was primarily attributable to graph loading, not the graph traversal itself.&lt;/p&gt;

&lt;p&gt;These were observations of a pilot deployment with active traffic and scheduled jobs, not a controlled comparison establishing universal speedups.&lt;/p&gt;

&lt;p&gt;Two separate low-load read-endpoint tests with five virtual users reported zero HTTP errors.&lt;/p&gt;

&lt;p&gt;The application saturation point remained unknown, because the CDN rate-limited the load generator before the origin saturated.&lt;/p&gt;

&lt;p&gt;The tests did not establish a maximum search throughput.&lt;/p&gt;

&lt;p&gt;These limitations matter when interpreting performance claims. Measured latency distributions, throughput baselines, and system capacity are different properties that require different evaluation methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Implications for Multimodal Travel Planning
&lt;/h2&gt;

&lt;p&gt;The experience suggests three broader considerations for transportation software engineering.&lt;/p&gt;

&lt;p&gt;First, route computation should distinguish graph connectivity from journey feasibility. A mathematically valid sequence of transport edges can still violate physical, temporal, or geographic constraints.&lt;/p&gt;

&lt;p&gt;Second, multicriteria itinerary selection requires an explicit treatment of trade-offs. Price, duration, transfers, and confidence are not interchangeable dimensions.&lt;/p&gt;

&lt;p&gt;Third, system architecture affects the quality of optimization under operational constraints. A sophisticated routing algorithm provides limited value if data acquisition, caching, or queue contention prevents results from reaching users within an acceptable response window.&lt;/p&gt;

&lt;p&gt;For multimodal travel planners, optimization must therefore be considered at both the algorithmic and system levels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A useful route optimization engine is not just a graph algorithm.&lt;/p&gt;

&lt;p&gt;It is a system that connects incomplete transportation evidence to feasible itineraries, manages uncertainty in schedules and fares, and preserves usable response times under limited resources.&lt;/p&gt;

&lt;p&gt;For Routavio, the most consequential design choice was to optimize for &lt;strong&gt;plausible, diverse, explainable travel options under bounded computation&lt;/strong&gt;, rather than claiming perfect optimization over a network that was neither complete nor fully live.&lt;/p&gt;

&lt;p&gt;The next articles examine the search heuristics, cache investigation, queueing failure, provider resilience, and language-model-assisted planning boundary individually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project:&lt;/strong&gt; &lt;a href="https://www.routavio.com" rel="noopener noreferrer"&gt;Routavio | Multimodal Travel Planner &amp;amp; Route Optimization&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;[1] Martins, E. Q. V. (1984). On a multicriteria shortest path problem. &lt;em&gt;European Journal of Operational Research&lt;/em&gt;, 16(2), 236–245. &lt;a href="https://doi.org/10.1016/0377-2217(84)90077-8" rel="noopener noreferrer"&gt;https://doi.org/10.1016/0377-2217(84)90077-8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. &lt;em&gt;Numerische Mathematik&lt;/em&gt;, 1, 269–271. &lt;a href="https://doi.org/10.1007/BF01386390" rel="noopener noreferrer"&gt;https://doi.org/10.1007/BF01386390&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] Hart, P. E., Nilsson, N. J., &amp;amp; Raphael, B. (1968). A formal basis for the heuristic determination of minimum cost paths. &lt;em&gt;IEEE Transactions on Systems Science and Cybernetics&lt;/em&gt;, 4(2), 100–107. &lt;a href="https://doi.org/10.1109/TSSC.1968.300136" rel="noopener noreferrer"&gt;https://doi.org/10.1109/TSSC.1968.300136&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[4] Delling, D., Pajor, T., &amp;amp; Werneck, R. F. (2015). Round-Based Public Transit Routing. &lt;em&gt;Transportation Science&lt;/em&gt;, 49(3), 591–604. &lt;a href="https://doi.org/10.1287/trsc.2014.0534" rel="noopener noreferrer"&gt;https://doi.org/10.1287/trsc.2014.0534&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[5] Bast, H., Delling, D., Goldberg, A., Müller-Hannemann, M., Pajor, T., Sanders, P., Wagner, D., &amp;amp; Werneck, R. F. (2016). Route planning in transportation networks. In &lt;em&gt;Algorithm Engineering&lt;/em&gt;, Lecture Notes in Computer Science, 9220, 19–80. &lt;a href="https://doi.org/10.1007/978-3-319-49487-6_2" rel="noopener noreferrer"&gt;https://doi.org/10.1007/978-3-319-49487-6_2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[6] Çınar, H. (2026). &lt;em&gt;Design and Implementation of a Multimodal Door-to-Door Travel Metasearch Platform with a Bounded Graph-Based Route Computation Engine and an Observability-Driven Deployment Pipeline&lt;/em&gt;. Sabancı University. Public technical edition, repository revision 71e8cd39, pp. 9–17, 30–33, 44–48.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Engineering measurements refer to the August 2026 pilot evaluation and should not be interpreted as guarantees of current platform performance.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>architecture</category>
      <category>travel</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
