资源简介
能求出任意两点间所有最短路径。数模时编写。考虑邻接矩阵中主对角线数据(虽然一般情况都取零)。更具实用性
代码片段和文件信息
function [sp spcost] = dijkstra_all(matriz_costo s d)
% This is an implementation of the dijkstra磗 algorithm wich finds the
% minimal cost path between two nodes. It磗 supoussed to solve the problem on
% possitive weighted instances.
% the inputs of the algorithm are:
%farthestNode: the farthest node to reach for each node after performing
% the routing;
% n: the number of nodes in the network;
% s: source node index;
% d: destination node index;
%For information about this algorithm visit:
%http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
%This implementatios is inspired by the Xiaodong Wang‘s implememtation of
%the dijkstra‘s algorithm available at
%http://www.mathworks.com/matlabcentral/fileexchange
%file ID 5550
%Author: Jorge Ignacio Barrera Alviar. April/2007
n=size(matriz_costo1);
S(1:n) = 0; %s vector set of visited vectors
dist(1:n) = inf; % it stores the shortest distance between the source node and any other node;
prev = zeros(50n); % Previous node informs about the best previous node known to reach each network node
count(1:n)=0;
dist(s) = 0;
while sum(S)~=n
candidate=[];
for i=1:n
if S(i)==0
candidate=[candidate dist(i)];
els
相关资源
- 基于OFDMA系统的多用户资源分配算法,
- matlab图像归一化代码
- EEMD的MATLAB程序
- MATLAB蒸气云爆炸模型VEC
- 提取图片纹理特征能量、熵、惯性矩
- 基于遗传算法的机器人路径规划matl
- BP神经网络实现手写数字识别matlab实现
- PCA人脸识别Eigenface特征脸Matlab
-
Matlab+Simuli
nk-cmi、miller、双相码 - 数字识别matlab源代码
-
MATLAB/simuli
nk短路电流仿真 - matlab2019运动目标检测--数字图像处理
- Allan方差分析MATLAB代码,含MPU6050八小
- 暗通道去雾MATLAB205097
- 自动寻峰谷算法matlab实现
- 基于MATLAB的车牌定位源程序
- 基于sift特征的人民币识别matlab版
- 《MATLAB仿真在现代通信中的应用》徐
- CARS-PLS 用于光谱数据或色谱数据变量
- matlab人脸皮肤分层、图像检测、检测
- CARS matlab 代码
- 基于MATLAB的OFDM系统仿真及性能分析
- AR模型算法的matlab实现和实验分析
- 基于自适应压扩法降低OFDM系统的峰均
- 自抗扰控制ADRC的MATLAB仿真+书籍资料
- matlab模式识别工具箱PRTOOLS及使用说明
- Dijkstra最短路径算法的Matlab实现
- matlab.m 获取wav文件基频 mel倒谱 ff
- Robust ICP (matlab)
- 均匀球体剖面重力异常正演模拟Matl
评论
共有 条评论