Java和VTK中良好的2D路径最小化算法

发布于 2024-10-06 09:22:33 字数 229 浏览 8 评论 0原文

我想找到一种带有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇纵 2024-10-13 09:22:34

如前所述,这听起来像是旅行推销员问题。我发现获得合理答案的一种方法是从三个节点开始(只有一种可能的解决方案),然后对于每个后续节点计算出在现有路径中插入节点最便宜的位置。它在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文