-
Notifications
You must be signed in to change notification settings - Fork 23
/
ringDN.m
25 lines (21 loc) · 736 Bytes
/
ringDN.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function [ contactSequence ] = ringDN(nNodes,timeInterval)
% Create a ring network with each edge connecting adjacent nodes.
%
% Inputs:
% nNodes = number of nodes
% timeInterval = 1 x 2 vector of start and end time
%
% Output:
% contactSequence = nNodes x 3 matrix with rows of form (i,j,t)
% indicating a contact between nodes i,j at time t.
%
%
% Reference: Ann E. Sizemore and Danielle S. Bassett, "Dynamic Graph
% Metrics: Tutorial, Toolbox, and Tale." Submitted. (2017)
%
% Main function:
contactSequence = zeros(nNodes,3);
contactSequence(:,1) = 1:nNodes;
contactSequence(:,2) = [2:nNodes 1];
contactSequence(:,3) = linspace(timeInterval(1),timeInterval(2),nNodes);
end