简体   繁体   English

车辆路线问题 - 如何完成/确定何时访问某些位置?

[英]Vehicle Routing Problem - How to finish/determine when certain locations are visited?

I have VRP problem.我有 VRP 问题。 I have vehicles starting positions and I have distance matrix.我有车辆起始位置,我有距离矩阵。 I want solution to be terminated/finished when certain locations are visited.我希望在访问某些位置时终止/完成解决方案。

So I don't want it to actually visit each index of location_matrix but if visiting different index beside "MUST VISITS" make for better solution then I have no problem.所以我不希望它实际访问 location_matrix 的每个索引,但如果访问“必须访问”旁边的不同索引可以获得更好的解决方案,那么我没有问题。 Because you know sometimes going from directly 1 to 3 is slower than 1-2-3.因为你知道有时直接从 1 到 3 比 1-2-3 慢。 (visiting 2 which is not necessary but make it for shortcut) (访问 2 不是必需的,但将其作为快捷方式)

I defined a dummy depot which cost 0, I used this for end because if you use starts you have to define ends.我定义了一个成本为 0 的虚拟仓库,我用它作为结束,因为如果你使用开始,你必须定义结束。 And I put ends 000 which are basically ending position.我把结尾 000 基本上结束了 position。 You might ask why you didnt put your "JOB" locations.您可能会问为什么没有放置“工作”位置。 But this means they have to end there.但这意味着他们必须到此为止。 So it doesn't seem optimal because example one vehicle could be really near to both of "JOB" locations but if it terminates / ends because it has END defined vehicle would stop.所以它似乎不是最优的,因为例如一辆车可能真的靠近两个“工作”位置,但如果它终止/结束,因为它有 END 定义的车辆将停止。

I have no idea how to make this work.我不知道如何使这项工作。 Basically what I want that if certain locations are visited once just terminate - that's the solution.基本上我想要的是,如果某些位置被访问一次只是终止 - 这就是解决方案。 So if jobs are (1,3,5) and Vehicle 1 visited 1,3 and Vehicle 2 just visited 2 it should be finished.因此,如果工作是 (1,3,5) 并且车辆 1 访问了 1,3 而车辆 2 刚刚访问了 2,则应该完成。

If I use solver in ortools It will be like TSP problem which will try to visit each location in distance_matrix.如果我在 ortools 中使用求解器,它将像 TSP 问题一样尝试访问 distance_matrix 中的每个位置。 I don't exactly want this.我不完全想要这个。 It could visit if results better solution(does it make sense?) but it should be focusing on "JOB" locations and how to go them faster如果结果更好的解决方案它可以访问(它是否有意义?)但它应该关注“工作”位置以及如何更快地 go

Potential approach: Compute a new distance matrix with only the "MUST VISIT" locations, and run a VRP with this matrix.潜在方法:计算仅包含“必须访问”位置的新距离矩阵,并使用此矩阵运行 VRP。

  • Compute a distance matrix with only the "MUST VISIT" locations.计算仅包含“必须访问”位置的距离矩阵。
  • Each cell contains the shortest path between two "MUST VISIT" locations.每个单元格包含两个“必须访问”位置之间的最短路径。
  • Store all the pairwise shortest paths found.存储找到的所有成对最短路径。
  • Run a regular VRP on this distance matrix.在此距离矩阵上运行常规 VRP。
  • Reconstruct the full path using the shortest paths found earlier.使用之前找到的最短路径重建完整路径。

暂无
暂无

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

相关问题 如何绘制谷歌或工具车辆路线问题解决方案? - How to graph Google OR Tools Vehicle Routing Problem Solution? 时间窗口崩溃的有能力车辆路线问题 - Capacitated Vehicle Routing Problem with Time Windows crashing 在 Or 工具中设置距离维度以解决车辆路径问题 - Setting distance Dimension in Or tools for vehicle routing problem 如何解释从 Google OR Tools 返回的 Vehicle Routing Problem 解决方案? - How do I interpret the Vehicle Routing Problem solution returned from Google OR Tools? 如何将服务时间约束添加到具有时间窗口约束的车辆路径问题 - How to add a servicing time constraint to a vehicle routing problem with time window constraints 如何使用 or-tools 在车辆路径问题中仅让部分行程返回车辆段? - How to make only some tours return to depot in vehicle routing problem with or-tools? 如何创建自动车辆路线模拟? - How to create an automated vehicle routing simulation? 不同起点站和终点站时间窗的车辆路径问题 - Vehicle routing problem with time windows at different start and end depot 更改目标 Function 以解决 Google ortools 中的车辆路径问题 - Change Objective Function for Vehicle Routing Problem in Google's ortools 使用 Google OR 工具解决车辆路径问题 (CVRPTW) 所需的时间取决于车辆容量的排序 - Time taken to solve a Vehicle Routing Problem (CVRPTW) using Google OR Tools depends on the ordering of vehicle capacity
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM