找到点的最短路径

编程入门 行业动态 更新时间:2024-10-22 23:44:35
本文介绍了找到点的最短路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨 我正在寻找一种在两个盒子之间绘制连接器的方法,它将在两个盒子之间绘制最短的非碰撞路径而不会与其他盒子碰撞 说我想从表格上的第25,10点画出一条路径并点200,225 这条线应该避免他们之间的任何和所有方框 规则是该线可以在x或y轴上增加/减少而不是两者(也就是说没有vet​​ors) 有人能给我一个快速简单的算法吗?

解决方案

Hello Chona1171, 针对您的问题,最常见的解决方案算法是使用 Dijkstra'的算法。 点击阅读 Dijkstra'的算法 有''这是CodeProject中的好文章: C# - 使用Dijkstra,AStar,双向Dijkstra和双向A *算法可视化路径查找 [ ^ ]

Hi I am looking for a way to draw a connector between two boxes that will draw the shortest non colliding path between two boxes without colliding with other boxes say I want to draw a path from point 25,10 on the form and point 200,225 and this line shoudl avoid any and all boxes between them also the rule is that the line can ony incremennt/decrememnet on the x or y axis not both (as to say no vetors) can anyone give me a quick easy algorithm to do this ?

解决方案

Hello Chona1171, A most common solution algorithm for your problem is to use the Dijkstra''s Algorithm. Click to read about Dijkstra''s Algorithm There''s this nice article in CodeProject: C# - Visualizing Path Finding With Dijkstra, AStar, Bi-directional Dijkstra''s, and Bi-directional A* Algorithms[^]

更多推荐

找到点的最短路径

本文发布于:2023-11-30 11:44:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1649848.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:最短   路径

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!