资源简介
最新的MATLAB-bgl工具箱,安装请自己上网找教程,很简单
代码片段和文件信息
function [DP] = all_shortest_paths(Avarargin)
% all_shortest_paths Compute the weighted all pairs shortest path problem.
%
% D = all_shortest_paths(A) returns the distance matrix D for all vertices
% where D(ij) indicates the shortest path distance between vertex i and
% vertex j.
%
% For the Floyd-Warshall algorithm this function can return the
% predecessor matrix as well:
% [D P]=all_shortest_paths(Astruct(‘algname‘‘floyd_warshall‘));
% returns P so that the P(ij) is the node preceeding j on the path from
% i to j. To build the path between (ij) use the commands
% p=[]; while j~=0 p(end+1)=j; j=P(ij); end; p=fliplr(p);
%
% ... = all_shortest_paths(Au...) takes a set of
% key-value pairs or an options structure. See set_matlab_bgl_options
% for the standard options.
% options.algname: the algorithm to use
% [{‘auto‘} | ‘johnson‘ | ‘floyd_warshall‘]
% options.inf: the value to use for unreachable vertices
% [double > 0 | {Inf}]
% options.edge_weight: a double array over the edges with an edge
% weight for each node see EDGE_INDEX and EXAMPLES/REWEIGHTED_GRAPHS
% for information on how to use this option correctly
% [{‘matrix‘} | length(nnz(A)) double vector]
%
% Note: ‘auto‘ cannot be used with ‘nocheck‘ = 1. The ‘auto‘ algorithms
% checks the number of edges in A and if the graph is more than 10% dense
% it uses the Floyd-Warshall algorithm instead of Johnson‘s algorithm.
%
% Example:
% load graphs/clr-26-1.mat
% all_shortest_paths(A)
% all_shortest_paths(Astruct(‘algname‘‘johnson‘))
%
% See also JOHNSON_ALL_SP FLOYD_WARSHALL_ALL_SP.
% David Gleich
% Copyright Stanford University 2006-2008
%% History
% 2006-04-19: Initial version
% 2006-05-31: Added full2sparse check
% 2007-03-01: Added option for predecessor matrix from floyd_warshall
% 2007-04-20: Added edge weight option
% 2007-07-08: Fixed typos in strings and documentation
% Removed fixes for the Johnson algorithm
% 2007-07-12: Fixed edge_weight documentation.
% 2007-07-21: Fixed divide by 0 error in check for algorithm type
% 2008-04-02: Added documenation for predecessor matrix
% 2008-10-07: Changed options parsing
%%
[trans check full2sparse] = get_matlab_bgl_options(varargin{:});
if full2sparse && ~issparse(A) A = sparse(A); end
options = struct(‘algname‘ ‘auto‘ ‘inf‘ Inf ‘edge_weight‘ ‘matrix‘);
options = merge_options(optionsvarargin{:});
% edge_weights is an indicator that is 1 if we are using edge_weights
% passed on the command line or 0 if we are using the matrix.
%edge_weights = 0;
edge_weight_opt = ‘matrix‘;
if strcmp(options.edge_weight ‘matrix‘)
% do nothing if we are using the matrix weights
else
edge_weight_opt = options.edge_weight;
end
if check
% check the values of the matrix
check_matlab_bgl(Astruct(‘values‘1));
% set the algname
if strcmpi(options.algname ‘auto‘)
nz = nnz(A);
if (nz/(numel(A)+1) > .1)
opti
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-10-22 16:37 matlab_bgl\
文件 3546 2008-10-22 16:36 matlab_bgl\all_shortest_paths.m
文件 1180 2008-10-22 16:36 matlab_bgl\test_matching.m
文件 1850 2008-10-22 16:36 matlab_bgl\boyer_myrvold_planarity_test.m
文件 2976 2008-10-22 16:36 matlab_bgl\max_flow.m
文件 2969 2008-10-22 16:36 matlab_bgl\edge_weight_index.m
文件 2080 2008-10-22 16:36 matlab_bgl\is_straight_line_drawing.m
文件 4560 2008-10-22 16:36 matlab_bgl\Contents.m
文件 794 2008-10-22 16:36 matlab_bgl\tree_from_pred.m
文件 1603 2008-10-22 16:36 matlab_bgl\dijkstra_sp.m
文件 1757 2008-10-22 16:36 matlab_bgl\bfs.m
文件 774 2008-10-22 16:36 matlab_bgl\circle_graph_layout.m
文件 1040 2008-10-22 16:36 matlab_bgl\wheel_graph.m
文件 3252 2008-10-22 16:36 matlab_bgl\core_numbers.m
文件 1071 2008-10-22 16:36 matlab_bgl\is_kuratowski_graph.m
文件 1416 2008-10-22 16:36 matlab_bgl\components.m
文件 1716 2008-10-22 16:36 matlab_bgl\path_from_pred.m
文件 1400 2008-10-22 16:36 matlab_bgl\prim_mst.m
文件 728 2008-10-22 16:36 matlab_bgl\star_graph.m
文件 886 2008-10-22 16:36 matlab_bgl\kolmogorov_max_flow.m
文件 2283 2008-10-22 16:36 matlab_bgl\dfs.m
文件 3048 2008-10-22 16:36 matlab_bgl\combine_visitors.m
文件 640 2008-10-22 16:36 matlab_bgl\test_dag.m
文件 5720 2008-10-22 16:36 matlab_bgl\mst.m
文件 463 2008-10-22 16:36 matlab_bgl\test_planar_graph.m
目录 0 2008-10-22 16:36 matlab_bgl\@inplace\
文件 269 2008-10-22 16:36 matlab_bgl\@inplace\subsasgn.m
文件 228 2008-10-22 16:36 matlab_bgl\@inplace\size.m
文件 195 2008-10-22 16:36 matlab_bgl\@inplace\display.m
文件 687 2008-10-22 16:36 matlab_bgl\@inplace\subsref.m
文件 319 2008-10-22 16:36 matlab_bgl\@inplace\double.m
............此处省略448个文件信息
- 上一篇:MATLAB聚类分析工具箱
- 下一篇:神经网络PID设计完整版
相关资源
- MATLAB聚类分析工具箱
- matlab robotics toolbox
- SVM算法对MNIST数据集分类
- 鱼雷控制系统计算机辅助分析设计与
- 抗干扰仿真 matlab 源码
- 信号与系统大作业 声音信号的频谱分
- matlab 蒙特卡罗
- LBF和LDF模型的matlab程序,用于图像分
- surf的matlab实现
- c均值聚类matlab算法和程序
- 图像加密算法实现 matlab
- PSAT-2.1.10最新版
- GPS信号捕获跟踪的MATLAB仿真,里面有
- 编写MATLAB函数 图像处理实验报告
- 基于MATLAB的OFDM通信系统模型的仿真毕
- 1维严格耦合波分析matlab程序
- Vibe算法,亲测可用,可用于视频前景
- Vibe背景建模的方法检测运动物体mat
-
Matlab_Simuli
nk环境下无人机全过程飞 - 基于MATLAB的BP神经网络应用绝对好资源
- 关于变声变调的matlab设计 比较详细
- 语音信号子带编码matlab程序subband_co
- MATLAB contourlet工具箱
- 贝叶斯网络工具箱MATLAB工具箱
- matlab bgl工具箱
- 图像滤波算法之guide filter导向滤波
- 利用MATLAB实现医学图像处理与分析
- 数字图像处理-matlab实验三次
- matlab传染病模型
- 贝叶斯压缩感知matlab源代码
评论
共有 条评论