📄 graphremoveduplicatelinks.m
字号:
function Graph = GraphRemoveDuplicateLinks(Graph)
% Removes duplicate links from the graph
%
% Receives:
% Graph - Graph Struct - the graph loaded with GraphLoad
%
% Returns:
% Graph - Graph Struct - the graph loaded with GraphLoad without duplicate links
%
% See Also:
% GraphLoad, GraphCountNumberOfLinks
%
% Created:
% Lev Muchnik 22/02/2005, Tel.: 972-054-4326496
%
% Major Changes:
% Lev Muchnik 20/10/2005, Tel.: 972-054-4326496
% A multiplication factor is now : (NumberOfNodes+1) and not just NumberOfNodes. This could
% cause problem in the extreme case when the last node was connected to the first node.
error(nargchk(1,1,nargin));
error(nargoutchk(0,1,nargout));
% NumberOfNodes = GraphCountNumberOfNodes(Graph);
if size(Graph.Data,1)>0
NumberOfNodes = max(max(Graph.Data(:,1:2)));
Indeces = Graph.Data(:,1)*(NumberOfNodes+1) + Graph.Data(:,2);
[Indeces m n]=unique(Indeces);
IndecesToKill = setdiff([1:GraphCountNumberOfLinks(Graph)],m);
Graph.Data(IndecesToKill,:)=[];
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -