⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prim_mst.m

📁 The MatlabBGL library fills a hole in Matlab s suite of algorithms. Namely, it provides a rich set o
💻 M
字号:
function [varargout] = prim_mst(A,options)
% PRIM_MST Compute a minimum spanning with Kruskal's algorithm.
%
% Prim's MST algorithm computes a minimum spanning tree for a graph.
%
% This method works on weighted symmetric graphs without negative edge
% weights.
% The runtime is O(E log (V)).
%
% See MST for calling information.  This function just calls
% mst(...,struct('algname','prim'));
%
% Example:
%    load graphs/clr-24-1.mat
%    prim_mst(A)
%
% See also MST, KRUSKAL_MST.

%
% David Gleich
% 23 April 2006
%

if (nargin > 1)
    options.algname = 'prim';
else
    options = struct('algname','prim');
end;

varargout = cell(1,nargout);

[varargout{:}] = mst(A,options);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -