I crate a file that represents 16000 edges with information of start node, end node and cost in a table.

In MATLAB i want to solve shortest path with PSO algorithm. How i can solve it?

enter image description here


Is there a particular reason why you want to use particle swarm optimization in this case?

If what you really want is to find the least-cost paths, you may consider using Dijkstra's algorithm. Here is one possible implementation, written in MATLAB (there are many): https://www.mathworks.com/matlabcentral/fileexchange/20025-dijkstra-s-minimum-cost-path-algorithm

As you only have 16000 edges, this is likely to be fast enough.

If it is not fast enough, you'll need an optimized, compiled implementation of Dijkstra's algorithm. I am not aware of any such implementations for MATLAB, though evidently there are some for Python (see my question here: C-based implementation of Djikstra's or Fast Marching for QGIS/Python?).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.