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

📄 graphgeneratecompletekpartitegraph.m

📁 复杂网络的一些节点面对攻击的代码
💻 M
字号:
function Graph = GraphGenerateCompleteKPartiteGraph(GroupSizes)
%Generates a complete k-Partite graph. sum(GroupSizes) of nodes are split into numel(GroupSizes) groups. Nodes in each groups are connected to all nodes outsized their group.
%
% Receives:
%   GroupSizes    -   vector of integers     -   List of group sizes. The graph will have sum(GroupSizes) nodes.
%
% Returns:
%   Graph   -   structure   -   The required graph. The format is identical to the one loaded with GraphLoad
%
% Example:
%   Graph =  GraphGenerateCompleteKPartiteGraph(2,3); 
%
% See Also:
%   ObjectCreateGraph, GraphGenerateCompleteGraph, GraphGenerateCompleteBipartiteGraph
%
% Algorithm:
%   http://mathworld.wolfram.com/CompleteBipartiteGraph.html
%
% Created:
% Lev Muchnik    20/03/2005, Tel.: 972-054-4326496
% Major Changes:

error(nargchk(2,2,nargin));
error(nargoutchk(0,1,nargout));


Groups = {};
Degree = 0;
for n = GroupSizes(:)
    Groups{end+1} = Degree+1 : n+Degree;
    Degree = Degree + n;
end
error('not implemented yet');

⌨️ 快捷键说明

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