File Exchange

image thumbnail

adjMatrixSpreadStud​y(A, s0, N, varargin)

version 1.0.0.0 (1.41 KB) by Lionel Tailhardat
Spreading of an event in a network graph through an adjacency matrix

28 Downloads

Updated 01 Jul 2017

View License

This function enables "event spreading" study in a network.
It is based upon adjacency matrix algebra, and suppose fixed time iteration period.
By providing an adjacency matrix and an event vector (consisting of the node by which the spreading starts), one can find 1) at which iteration the event has spread over the whole network, 2) history of the nodes states in regard to the spreading.
Optionnaly, a GraphML output of each iteration will be exported for visual analysis.
Traversal of the various initial states can be automated with the following code. The temporal of each full-spread run will be available in the t_ret variable :
sourceFilePath = 'C:\Temp\adj_matu.txt';
A = importdata(sourceFilePath);
size_A = size(A, 1);
N = 50;
t_ret = [];
for i = 1 : size_A
s00 = zeros(1, size_A);
s00(1,i) = 1;
t = adjMatrixSpreadStudy(A, s00, N);
t_ret = [t_ret t];
end

Cite As

Lionel Tailhardat (2021). adjMatrixSpreadStudy(A, s0, N, varargin) (https://www.mathworks.com/matlabcentral/fileexchange/63600-adjmatrixspreadstudy-a-s0-n-varargin), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!