% Indices of the multi-brain network
% Example by Yafeng Pan, ECNU, April 27,2016
% Reference: Duan, L., Dai, R. N., Xiao, X., Sun, P. P., Li, Z., & Zhu, C. Z. (2015). Cluster imaging of multi-brain networks (CIMBN): a general framework for hyperscanning and modeling a group of interacting brains. Frontiers in neuroscience, 9.
% Rely on: folder and subfloder of "networkproperties"

clc;clear;close all;
% Construct adjacency matrix
% A = [0 1 0 0 1 0 0 0 1; 1 0 1 0 1 1 0 1 0; 0 1 0 0 1 1 1 1 0; 0 0 0 0 0 0 0 1 0; 1 1 1 0 0 1 0 0 0; 0 1 1 0 1 0 1 1 0; 0 0 1 0 0 1 0 1 0; 0 1 1 1 0 1 1 0 0;1 0 0 0 0 0 0 0 0];
A = [0	0	1	0	0
0	0	0	0	0
0	1	0	1	0
0	0	1	1	1
0	0	0	0	0]
N = size(A,1);

% Compute Degree
Degree = degrees_dir(A);

% Compute Global efficiency
[E_i,E]=efficiency(A);
Nodal_global_efficiency = (E_i/(N-1))';
Network_global_efficiency = E;

% Compute Local efficiency
Nodal_local_efficiency =(efficiency(A,1))';
Network_local_efficiency = mean (Nodal_local_efficiency);

% Compute Betweenness
Betweenness = betweenness_bin(A);

% Display results
Degree
Nodal_global_efficiency
Network_global_efficiency
Nodal_local_efficiency
Network_local_efficiency
Betweenness