function [res] = contacts2matrix( input_matrix, total )
% Create a symmetric matrix with the number of contacts between nodes i and j
%   input_matrix: the imported dataset, in matrix form
%   total: the total number of nodes

res = zeros(total);

s = size(input_matrix);

nrows = s(1);

for ii = 1:nrows
    if (input_matrix(ii,1) <= total) && (input_matrix(ii,2) <= total)   % ignore node IDs higher than the total number
        res(input_matrix(ii,1), input_matrix(ii,2)) = res(input_matrix(ii,1), input_matrix(ii,2)) + 1;
        res(input_matrix(ii,2), input_matrix(ii,1)) = res(input_matrix(ii,2), input_matrix(ii,1)) + 1;
    end
end

return;
end


