<?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: Cédric Hervet, Ph.D.</title>
    <description>The latest articles on DEV Community by Cédric Hervet, Ph.D. (@chervet).</description>
    <link>https://dev.to/chervet</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%2Fuser%2Fprofile_image%2F4017881%2Fbf157b0a-80ba-4a56-bb8f-f85a10cb07bb.png</url>
      <title>DEV Community: Cédric Hervet, Ph.D.</title>
      <link>https://dev.to/chervet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chervet"/>
    <language>en</language>
    <item>
      <title>Why the hard part of route optimization is the modeling, not the algorithm</title>
      <dc:creator>Cédric Hervet, Ph.D.</dc:creator>
      <pubDate>Tue, 15 Sep 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/chervet/why-the-hard-part-of-route-optimization-is-the-modeling-not-the-algorithm-3dc6</link>
      <guid>https://dev.to/chervet/why-the-hard-part-of-route-optimization-is-the-modeling-not-the-algorithm-3dc6</guid>
      <description>&lt;p&gt;Everyone benchmarks the algorithm. Almost nobody talks about the layer that actually breaks projects: modeling.&lt;/p&gt;

&lt;p&gt;Route optimization projects rarely fail on the algorithm. Between a business rule and a routed plan sit two other layers: whether the modeling language can express the rule at all, and whether someone stated it correctly.&lt;/p&gt;

&lt;p&gt;The first is &lt;strong&gt;modeling distance&lt;/strong&gt;, the gap between how a rule exists in an operation and how a formalism lets you write it down. It's an engineering problem, and it's countable: 61 abstract primitives producing 149 sector variants in our library as of August 2026. The second is human, and it gives no signal when it fails. It's where most of the last ten years of customer projects went, and it's what still stands between route optimization and a self-serve product.&lt;/p&gt;

&lt;p&gt;A delivery time window is a business constraint. In almost every routing API it's also an object: set a start, set an end, done. No modeling effort at all.&lt;/p&gt;

&lt;p&gt;A minimum daily revenue below which a subcontractor refuses a route is also a business constraint. It's an object nowhere. It has to be built from whatever the formalism offers, assuming it offers enough, and assuming somebody realized the rule existed.&lt;/p&gt;

&lt;p&gt;Both bind the plan equally. The distance between them is the subject of this article, and it has nothing to do with the algorithm.&lt;/p&gt;

&lt;h2&gt;
  
  
  The layer everyone benchmarks is the one that rarely fails
&lt;/h2&gt;

&lt;p&gt;Solvers get compared on speed, on gap to optimality (how far a solution sits from the mathematical best), on stops absorbed. Those comparisons are legitimate, and we run them on our own engine. They're also the wrong place to look for why a project failed.&lt;/p&gt;

&lt;p&gt;The algorithmic problem is hard, and it's well served. Vehicle routing has been studied for sixty years, metaheuristics (general-purpose search algorithms) work, and a competent commercial solver beats experienced planners on distance or vehicle count by a wide margin. We've made that argument ourselves. That success created the blind spot: gains that large made the algorithm look like the whole product.&lt;/p&gt;

&lt;p&gt;In ten years we haven't seen a project fail because the solver was too slow. We've seen plenty fail because the plan described an operation that didn't exist.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three layers sit between a business rule and a solver. Only one is the algorithm.
&lt;/h2&gt;

&lt;p&gt;Getting from a rule that exists in an operation to a plan that respects it takes three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Expressivity&lt;/strong&gt; — Can this rule be stated in the modeling language at all? Engineering problem, inside the solver.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formulation&lt;/strong&gt; — Has it been stated correctly, with the right hardness and scope? Human problem, between operations and mathematics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search&lt;/strong&gt; — Given a correct statement, how good a solution, how fast? Algorithmic problem.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The industry benchmarks the third layer. Projects fail in the first two.&lt;/p&gt;

&lt;p&gt;The upper layers get collapsed into one, and the time window example shows why: when a formalism has a native object for a rule, expressing it and expressing it correctly happen in the same gesture. They come apart as soon as the rule has no native object.&lt;/p&gt;

&lt;p&gt;They also fail differently. When you hit an expressivity limit, you notice fast: you look for a way to state your rule, you don't find one, and you know within the hour. A formulation error hides better. You state the rule easily, you state it wrong, and nothing signals it.&lt;/p&gt;

&lt;p&gt;A third case sits between the two, and it's the one that misleads. The primitive that carries your rule exists, but it's abstract enough that the mapping isn't obvious, so the developer concludes the API can't do it. That's a translation failure dressed as an expressivity limit. It usually ends in a workaround built outside the model, where the solver can't see it and can't optimize against it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a time window is free and a subcontractor floor is not
&lt;/h2&gt;

&lt;p&gt;Modeling distance is the gap between how a rule exists in an operation and how the formalism lets you write it down. It's a property of the formalism, not of the rule. The same constraint carries a different modeling distance in different tools.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero distance&lt;/strong&gt; — the rule has a native object. A time window in a modern routing API: two fields, nothing to translate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Moderate distance&lt;/strong&gt; — the rule has no native object, but the formalism offers abstract constructs that can carry it. Most real constraints live here, and the subcontractor floor is one of them. No routing API on the market exposes it as an object, ours included, so it has to be assembled from abstract primitives. We tested the rule across eleven APIs. Three could express it, each in its own way. For the other eight, we found no way to state it at all. Possibly one exists and we missed it, which is exactly the third case above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maximal distance&lt;/strong&gt; — the formalism is a general mathematical language and every constraint is an engineering project. Writing a rich vehicle routing problem directly in mixed integer programming is the reference case [5]. Each rule costs days.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reducing modeling distance is a product decision. It determines how much work lands on developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  61 primitives, 149 sector variants: what expressivity actually costs to build
&lt;/h2&gt;

&lt;p&gt;Reducing modeling distance means turning constraints that would be engineering projects into native constructs. That's a solver problem, and it's the central engineering challenge of any optimization engine whatever its domain or solving technique [5]. Adding expressivity isn't the hard part; adding it without degrading solver performance is. Every construct you make native is one the engine has to handle efficiently inside the search, which is likely why eight of the eleven APIs we tested can't express the subcontractor floor. Not an oversight on their side, but a trade they made.&lt;/p&gt;

&lt;p&gt;As of August 2026, Kardinal's library holds 61 abstract primitives in 11 categories, producing 149 concrete constraints across the 7 sectors we work in. Those are the ones we've encountered. It's an inventory of what ten years of projects surfaced, not a claim about the boundaries of the problem.&lt;/p&gt;

&lt;p&gt;The duplication is deliberate: one formalism carries different operational meanings by sector. Maximizing preferential assignment between stops and resources means matching a driver to their home zone in parcel delivery, and matching a junior technician to easy interventions in field service. Same mathematics, different conversation, different ways of getting it wrong.&lt;/p&gt;

&lt;p&gt;Which is why a new business rule rarely means a new primitive. Constraints we've never seen before are the minority case, and when they do appear, most turn out to be expressible with primitives that already exist.&lt;/p&gt;

&lt;p&gt;Expressivity is also the one layer an outsider can compare, using nothing but public documentation. We've been publishing that comparison since 2024, and we know of no equivalent from anyone else. &lt;a href="https://kardinal.ai/benchmark-route-optimization-api-2026/" rel="noopener noreferrer"&gt;Our 2026 benchmark of eleven routing APIs&lt;/a&gt; tests them against a constraint list we rebuilt from scratch. We're not a neutral party in it, which is why the constraint list and the scoring method are published rather than summarized.&lt;/p&gt;

&lt;h2&gt;
  
  
  A perfect formalism still doesn't make the model correct
&lt;/h2&gt;

&lt;p&gt;There's a tempting conclusion here: keep pushing expressivity and the modeling problem disappears. Give every rule a native object and nothing is left to translate.&lt;/p&gt;

&lt;p&gt;The time window shows why not. The object is native, the modeling distance is zero, and these questions are all still open. Is the window hard or penalized? Does it apply to arrival or end of service? Is a five-minute overrun a failure or a degradation? Does it hold when the customer is absent? Each answer changes the plan, and none of them gets easier just because the object is well-defined.&lt;/p&gt;

&lt;p&gt;Expressivity lowers the cost of translation. It rarely lowers the cost of specification.&lt;/p&gt;

&lt;p&gt;Operations research named this failure long before routing software existed: the Type III error Kimball described in 1957, giving the right answer to the wrong problem [1]. How a problem gets framed in the first place is among the strongest determinants of the solution you end up with [2].&lt;/p&gt;

&lt;p&gt;Our subcontractor case is exactly that. A shipper pays an internal fleet per kilometer and subcontractors per task. Optimize that cost model and the solver rationally hands dense routes to the internal fleet and thin ones to subcontractors. The plan is optimal and unrunnable, because a subcontractor still pays for a full driver shift and declines anything below a certain daily revenue. That floor was written down nowhere. Planners had applied it for years without ever stating it. No amount of expressivity would have helped, because nobody had asked the question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who can actually do this, and why it doesn't scale
&lt;/h2&gt;

&lt;p&gt;Formulation requires holding two things at once: how the operation actually runs, and what the formalism will do with a given statement of it. The same need can be modeled several ways with different side effects, and knowing which one produces which behavior is the entire skill.&lt;/p&gt;

&lt;p&gt;That person sits in one of two places. Inside the customer, an operations profile with an unusually analytical turn of mind, rare enough that we don't plan around it. Or inside the vendor.&lt;/p&gt;

&lt;p&gt;We built the second. Our solution engineers do this work and they're why our projects converge. They're also a bottleneck hiring doesn't remove: the profile is rare, and every project consumes one of them from first workshop to production. That's workable for enterprise projects. It's impossible for a self-serve API.&lt;/p&gt;

&lt;p&gt;Which leaves this category with one open question, and it's not an algorithmic one. The expertise that turns an operation into a correct formulation exists, but it's written down almost nowhere a machine can read. Today it only exists inside the people who do this work project after project.&lt;/p&gt;




&lt;p&gt;Curious how others here have dealt with this. If you've built domain expertise into a system, an agent, a rules engine, whatever, how did you get that tacit knowledge out of someone's head and into something a machine could actually use? Did it work, or did you hit the same wall we did?&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Kimball, A. W., &lt;a href="https://doi.org/10.1080/01621459.1957.10501374" rel="noopener noreferrer"&gt;Errors of the Third Kind in Statistical Consulting&lt;/a&gt;, Journal of the American Statistical Association, 52(278), 1957, pp. 133–142.&lt;/li&gt;
&lt;li&gt;Mitroff, I. I. and Featheringham, T. R., &lt;a href="https://doi.org/10.1002/bs.3830190605" rel="noopener noreferrer"&gt;On Systemic Problem Solving and the Error of the Third Kind&lt;/a&gt;, Behavioral Science, 19(6), 1974, pp. 383–393.&lt;/li&gt;
&lt;li&gt;Caceres-Cruz, J. et al., &lt;a href="https://doi.org/10.1145/2666003" rel="noopener noreferrer"&gt;Rich Vehicle Routing Problem: Survey&lt;/a&gt;, ACM Computing Surveys, 47(2), 2014.&lt;/li&gt;
&lt;li&gt;Drexl, M., &lt;a href="https://logistik.bwl.uni-mainz.de/files/2018/12/LM-2011-04.pdf" rel="noopener noreferrer"&gt;Rich Vehicle Routing in Theory and Practice&lt;/a&gt;, Technical Report LM-2011-04, Johannes Gutenberg University Mainz, 2011.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://arxiv.org/abs/2105.10950" rel="noopener noreferrer"&gt;A Review of Approaches to Modeling Applied Vehicle Routing Problems&lt;/a&gt;, arXiv:2105.10950, 2021.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>api</category>
      <category>computerscience</category>
      <category>algorithms</category>
      <category>software</category>
    </item>
  </channel>
</rss>
