Here is a simple implementation of Dijkstra's algorithm in Matlab for finding the shortest path between two nodes in a graph:
main.m1424 chars42 lines
An example usage of the function would be:
main.m317 chars15 lines
Note that the graph input is expected to be an adjacency matrix, where each row and column correspond to nodes in the graph, and the value in each cell corresponds to the weight of the edge between the corresponding nodes.
gistlibby LogSnag