title: How to bundle pairs of trips?
body: <p>I have a database of optional real-time trip demands. Each with a load that can to be delivered from a departure point to a destination:</p>
  <pre><code>ID,EndDateEnd,EndDateStart,StartDateEnd,StartDateStart,DepX,DepY,ArrX,ArrY
  1,2021-03-04,2021-03-03,2021-03-02,2021-03-01,2.83689,47.3324,-0.5854,44.83814
  2,2021-03-04,2021-03-03,2021-03-02,2021-03-01,2.44774,47.56044,0.13888,49.49015
  3,2021-03-10,2021-03-09,2021-03-08,2021-03-07,2.76755,47.97472,0.65567,48.78064
  ...
  </code></pre>
  <p>It is a list of load offers that companies need delivered at a certain location and time.</p>
  <p>My goal is to bundle pairs of loads that increase my truck's paid miles. I normally have a set destination and origin. Let's say I'm going from NYC to CHICAGO. Then I search on the trip database for loads that need to be delivered along that route. Imagine I find one with a pickup in Pittsburg and delivery in Cleveland. Then my paid miles would be the driving distance from Pittsburg to Cleveland. But I'm not getting paid for getting from NYC to Pittsburg or from Cleveland to Chicago. A picture is better for explaining:</p>
  <p><a href="https://i.stack.imgur.com/3QDA7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3QDA7.png" alt="enter image description here" /></a></p>
  <p>In blue you can see the paid miles and red the not paid miles. If I could find another load from NYC to Pittsburgh it would be great or Cleveland-Chicago as well.</p>
  <p>Now the question is how can I algorithmically find pairs of loads that <strong>go well together</strong> given a route? I know my part and end of the trip. I just need to go through the list of trips to find the best ones for me.</p>
  <p>-Going well together is a loose definition. Generally speaking increasing the % of paid miles is the goal.</p>
  <p>One solution I have researched:</p>
  <p>You could define that two loads &quot;go well together&quot; if the miles driven from only one truck doing both loads is lower than two trucks doing each one of the loads.</p>
  <p>That is the intuition behind the Clark and Wright Savings Method.</p>
  <p><a href="https://i.stack.imgur.com/t1Hsv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t1Hsv.png" alt="enter image description here" /></a></p>
  <p>Being d your favourite distance function. In our example, start is NYC and END is Chicago. The pickups and deliveries are from the candidate pairs of bundles. If the savings are high then it is a good bundle.</p>
  <hr />
  <p>This is a type of vehicle routing problem that is sometimes called pick up and delivery with time windows(PDPTW) I'm trying to solve a smaller part of them problem. Just finding useful pairs of trips.</p>
  <p>Are there any other solutions out there? Scaleable approaches to bundling?</p>
  <p>Relevant Research Papers:</p>
  <ul>
  <li><a href="https://www.sciencedirect.com/science/article/abs/pii/S0377221709002999" rel="nofollow noreferrer">Pick up and delivery problems</a></li>
  <li><a href="https://api.research-repository.uwa.edu.au/ws/portalfiles/portal/33899497/THESIS_DOCTOR_OF_PHILOSOPHY_BRAUN_Hendrik_2018.pdf" rel="nofollow noreferrer">Freight market</a></li>
  </ul>
  <p>Cross post:
  <a href="https://or.stackexchange.com/questions/8159/how-to-bundle-pairs-of-trips">https://or.stackexchange.com/questions/8159/how-to-bundle-pairs-of-trips</a></p>