mexgraphmergenodes.m

来自「复杂网络的一些节点面对攻击的代码」· M 代码 · 共 32 行

M
32
字号
function [Links varargout]= mexGraphNodes(Graph, RedirectionList)
% Redirects links in 'Graph' from each node in column 1 of 'RedirectionList' to the corresponding node of the column 2.
% Multiple redirections are supported (ex. 1->2, 2->3, 3->4 => 1->4).
% 
% Receives:
%   Graph             -   struct      -   Graph created with GraphLoad or ObjectCreateGraph
%						  Nx2 or Nx3 of IDs  -   List of links. Can be used to split huge graphs into smaller components.
%   RedirectionList   -   matrix Nx2  -   Matrix of Node IDs. All links to/from nodes in first columns are redirected to correcponding
%                                         node in column 2. Eventually, no links will point at nodes in col.1. Each node in col. 1 will
%                                         point at the corresonding node at col. 2.
% 
% Returns:
%   Links           -   matrix Mx3		-  List of links with weights (all weights are set to 1). 
%	RedirectionList	-	matrix Nx2		-	(optional) The final list of redirections. Built from the original 'RedirectionList' via relaxation.
% 
% Algorithm:
%   Run time: O(M*N).
%
% See Also:
%   WikiRelaxRedirects
%
% Created:
%   Lev Muchnik    10/2005, Tel.: 972-054-4326496
%
% Major Updates:
%   Lev Muchnik    23/10/2005, Tel.: 972-054-4326496
%	Optional 'RedirectionList' parameter added to the method output.
%
% Major Updates:
%   Lev Muchnik    25/10/2005, Tel.: 972-054-4326496
%   Graph can now be a matrix with a list of links.	

⌨️ 快捷键说明

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