简体   繁体   English

带时间窗的车辆路线选择Python实现

[英]Vehicle routing with time window Implementation in Python

I am working on a use case, in which I have multiple vehicles as depot,delivery boys and set of customers from diverse location to serve fresh food. 我正在研究一个用例,其中有多辆车作为仓库,送货员和来自不同地点的客户群提供新鲜食品。 Customers would place an order from an application,then delivery boy receives the order and get the food from Van and then deliver it with some promised delivery time(15 mins). 客户将通过应用程序下订单,然后送货员收到订单并从Van那里获取食物,然后在约定的交货时间(15分钟)内交货。 I want to optimize this problem so that operational cost for traveling is reduced and delivery time is minimized. 我想优化这个问题,以减少旅行的运营成本并最大程度地缩短交货时间。 Just wanted to know is there any implementation in Python so solve VRPTW problem ? 只想知道Python中有什么实现可以解决VRPTW问题吗? Please help 请帮忙

You can find implementation of Dijkstra shortest path algorithm in python. 您可以在python中找到Dijkstra最短路径算法的实现。

An example implementation is 一个示例实现是

http://code.activestate.com/recipes/577506-dijkstra-shortest-path-algorithm/ http://code.activestate.com/recipes/577506-dijkstra-shortest-path-algorithm/

read some research papers on vehicle routing problem. 阅读有关车辆路径问题的一些研究论文。 i've seen some of the papers provides a complete algorithm on vehicle routing, and they come in different ways by considering multiple criteria. 我已经看到一些论文提供了有关车辆路径的完整算法,并且考虑了多个标准,它们以不同的方式出现。 hence, it's possible to implement one or more of the algorithms provided in these papers and do a test to use the optimal solution. 因此,可以实现这些论文中提供的一种或多种算法,并进行测试以使用最佳解决方案。

If you want to solve a routing problem, the very first thing to figure out is what variant of the vehicle routing problem you're solving. 如果要解决路线问题,首先要弄清的是要解决的车辆路线问题的变体。 I'm going to assume the vans are stationary (ie you're not trying to optimise the positioning of the vans themselves as well). 我将假设货车是固定的(即,您也不会尝试优化货车本身的位置)。 Firstly the problem is dynamic as it's happening in realtime - ie it's a realtime route optimisation problem. 首先,问题是动态的,因为它是实时发生的-即,这是实时路线优化问题。 If the delivery people are pre-assigned to a single van, then this might be considered a dynamic multi-trip vehicle routing problem (with time windows obviously). 如果将送货人员预先分配到一辆面包车,则这可能被视为动态多程车辆路线问题(明显带有时间窗)。 Generally speaking though it's a dynamic pickup and delivery vehicle routing problem, as presumably the delivery people can pickup from different vans (so DPDVRPTW). 一般来说,尽管这是一个动态的取件和送货车路线问题,但据推测,送货人员可以从不同的货车取货(因此DPDVRPTW)。 You'd almost certainly need soft timewindows as well, making it a DPDVRP with soft time windows. 您几乎肯定还会需要软时间窗口,使其成为具有软时间窗口的DPDVRP。 Soft time windows are essential because in a realtime setting you generally want to deliver as fast as possible, and so want to minimise how late you are. 柔和的时间窗口是必不可少的,因为在实时设置中,您通常希望尽快交付,因此希望尽量减少您的延迟。 Normal 'hard' time windows like in the VRPTW don't let you deliver after a certain time, but place no cost penalty on delivering before this time (ie they're binary). 像VRPTW中一样,正常的“困难”时间窗口不允许您在特定时间后交货,但是在此时间之前交货不会造成任何成本损失(即,它们是二进制的)。 Therefore you can't use them to minimise lateness. 因此,您不能使用它们来最大程度地减少延迟。

I'm afraid I don't know of any open source solver in python or any other language that solves the dynamic pickup and delivery vehicle routing problem with soft time windows. 恐怕我不知道使用python或任何其他语言可以解决带有软时间窗口的动态取货和送货车辆路线问题的开源求解器。

This survey article has a good overview of the subject. 这篇调查文章对此主题有很好的概述。 We also published a white paper on developing realtime route optimisers, which is probably an easier read than the academic paper. 我们还发布了有关开发实时路线优化器的白皮书 ,这可能比学术论文更容易阅读。 (Disclaimer - I am the author of this white paper). (免责声明-我是本白皮书的作者)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将服务时间约束添加到具有时间窗口约束的车辆路径问题 - How to add a servicing time constraint to a vehicle routing problem with time window constraints 时间窗口崩溃的有能力车辆路线问题 - Capacitated Vehicle Routing Problem with Time Windows crashing Or-tools带有中断的Python车辆路由问题 - Or-tools Python Vehicle Routing Prob with Breaks 不同起点站和终点站时间窗的车辆路径问题 - Vehicle routing problem with time windows at different start and end depot 使用 Google OR 工具解决车辆路径问题 (CVRPTW) 所需的时间取决于车辆容量的排序 - Time taken to solve a Vehicle Routing Problem (CVRPTW) using Google OR Tools depends on the ordering of vehicle capacity 带有非连接图或工具 Python 的车辆路由问题 - Vehicle Routing Prob with non-connected graph or-tools Python 不同车速的车辆路线(谷歌或工具) - Vehicle Routing with Different Vehicle Speed (Google OR Tools) 是否有针对此 Python/Google OR 车辆路由工具程序的简单修复,使其按预期工作? - Is there a simple fix for this Python/ Google OR tools program for Vehicle Routing to make it work as intended? 如何创建自动车辆路线模拟? - How to create an automated vehicle routing simulation? Google OR 工具 - 带取货和送货的车辆路线 - Google OR-tools- Vehicle Routing with Pickups and Deliveries
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM