資源簡介
計算最短路徑的matlab代碼,適用于稀疏矩陣
代碼片段和文件信息
function?[d?pred]?=?dijkstra_sp(Auvarargin)
%?DIJKSTRA_SP?Compute?the?weighted?single?source?shortest?path?problem.
%
%?Dijkstra‘s?algorithm?for?the?single?source?shortest?path?problem?only
%?works?on?graphs?without?negative?edge?weights.
%
%?This?method?works?on?weighted?directed?graphs?without?negative?edge
%?weights.
%?The?runtime?is?O(V?log?(V)).
%
%?See?the?shortest_paths?function?for?calling?information.??This?function?
%?just?calls?shortest_paths(...struct(‘algname‘‘dijkstra‘));
%
%?The?options?structure?can?contain?a?visitor?for?the?Dijkstra?algorithm.??
%
%?See?http://www.boost.org/libs/graph/doc/DijkstraVisitor.html?for?a?
%?description?of?the?events.
%?
%?visitor?is?a?struct?with?the?following?optional?fields
%????vis.initialize_vertex(u)
%????vis.discover_vertex(u)
%????vis.
- 上一篇:二維碼識別系統 MATLAB
- 下一篇:低秩表示模型
評論
共有 條評論