function [s_0,badj] = NF_constantProb(nnodes,p)
%% Node filtering model with edges determined by f(n) = p, a constant.

% Inputs:
    % nnodes        Number of nodes.
    % p             Probability of edges existing.
    
 
% Outputs:
    % s_0           Node ordering (1:nnodes).
    % badj          Binary adjacency matrix in s_0 order.
    
%
% Reference: Ann E. Sizemore, Elisabeth A. Karuza, Chad Giusti, Danielle S.
% Bassett, Knowledge gaps in the early growth of semantic networks.
% Submitted.
%
%% Main function:
    
    
% Preallocate
badj = zeros(nnodes);


% Run model
for n = 1:nnodes
    
    for j = 1:(n-1)
        
        % We will add an edge with probability 1/n^d
        
        r = rand;
        
        if r < p
            
            badj(n,j) = 1;
            badj(j,n) = 1;
            
        end
        %disp(j)
    end
    
    
end
        
    
s_0 = 1:nnodes;

end

