Shortest path (all pair shortest path)

Finds all pair shortest path.
2.5K Downloads
Updated 30 Mar 2009

View License

Outperforms other algorithms in speed and memory requirement especially for large dataset.

%function [costs] = mdijkstra(A,C)
%
%A=square matrix (either adjacency or cost)
%
%if C=1 then A=adjacency matrix
% where, element(i,j)=1 when vertex v is directly connected with j
% else (i,j)=0
%
%if C=2 then A=cost matrix
% where, element (i,j) represents positive integer representing cost
% between vertex i and j
%
% Output: [costs]: calculated cost matrix
% Developed by: Bharat Patel
% Release date: 03/28/2009

Cite As

Bharat Patel (2024). Shortest path (all pair shortest path) (https://www.mathworks.com/matlabcentral/fileexchange/23462-shortest-path-all-pair-shortest-path), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

Corrected discription

1.0.0.0