iOS上的dijkstra算法

我正在跟踪位置及其与其他位置的连接.
我将位置保存在NSArray中,而每个位置都表示为字典.每个位置都有Dictionary具有属性(locationName,Connections,纬度,经度),其中Connections是此位置连接到的其他位置的数组(不是来自).我使用lat / lon和haversine算法来确定两点之间的距离.

NEXT,我想使用dijkstra的最短路径算法来查找源和目标位置之间的最短路径(用户选择源和目标)

这不是商业用途,不需要支持数百或数千个位置.

我正在寻找一些将执行此搜索的客观C代码.

解决方法

一个快速的谷歌在 snyderp / PESGraph发现了一些Objective-c代码

PESGraph is a simple graph implementation for Foundation.kit that
allows for greating structures of nodes and paths,and then finding
the shortest path between them. It includes unit tests that also
provide some examples of how to use the code.

此问题之前也在SO theres-an-easy-way-to-apply-a-shortest-path-alghoritm-in-objective-c上提出,解决方案指向我通过谷歌找到的相同git存储库.

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...