将这个问题解决为 k 最短路径会遇到这样一个事实,即您不知道如何选择k
。
按照公认的答案建议解决它,受到以下事实的困扰:您需要维护dist[v,k]
来自从源到达节点 v 的所有不同路径的潜在所有 k 值(这导致算法效率非常低)。
有一些伪多项式时间算法可以解决这个问题,正如您所料,它被称为“具有资源约束的最短路径问题”(SPPRC)。该问题经常出现在车辆路线问题 (VRP) 和机组配对问题(两者都是运输问题,主要在运筹学中处理)中。有关起点,请参见以下(评论)论文:S. Irnich & G. Desaulniers,“Shortest Path Problems with Resource Constraints”,G. Desaulniers、J. Desrosiers、M. Solomon(编辑):Column Generation,Springer, 2005 年。
You can google for the title of the paper, and you should be able to download it for free. I should mention though that your problem has an unusual constraint structure: namely, you need to "spend" at least a certain amount of a resource instead of making sure you don't spend "too much" of a resource...