Java和VTK中良好的2D路径最小化算法
我想找到一种带有 VTK 的 Java 中带有一些约束的路径最小化算法。作为输入,我将给出恒定的多边形面积、多边形的质心和成本图像。作为输出,我想要一个组成二维路径的点列表,该路径是成本图像上满足特定区域和质心两个约束的最小路径长度。有谁知道用 Java 和 VTK 做到这一点的方法吗?我正在考虑构建 vtkDijkstraImageGeodesicPath,但我什至不知道从哪里开始。老实说,我在这个领域的数学很生疏。
谢谢
I would like to find an algorithm for path minimization with some constraints in Java with VTK. As input I am going to give an area for the polygon which is constant, the center of mass of the polygon, and a cost image. As output I'd like a list of points which compose a path in 2D that is the minimal path length on the cost image satisfying the two constraints of specific area and center of mass. Does anyone know of a way to do this with Java and VTK? I was looking at building off of vtkDijkstraImageGeodesicPath, but I'm not sure even where to start. Honestly, my math in this field is rusty.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如前所述,这听起来像是旅行推销员问题。我发现获得合理答案的一种方法是从三个节点开始(只有一种可能的解决方案),然后对于每个后续节点计算出在现有路径中插入节点最便宜的位置。它在 n^2 时间内工作,当然不会给你最好的解决方案,但它应该给出合理的解决方案。
As mentioned it sounds like the travelling salesperson problem. One way I have found to get reasonable answers is to start with three nodes (only one possible solution) and then for each subsequent node work out where it is cheapest to insert the node in the existing path. It works in n^2 time and is certainly not going to give you the best solution, but it should give reasonable solutions.