%steady_vector=googleRank(F,varF,nv,c,p,pp)

%This function uses the Google PageRank algorithm to find the distribution of time spent at each state over a large amount of time

%Parameters:
%F, varF, nv,p: corresponding to boolean network we are walking on 
%pp- (1-pp) is the chance we have of randomly going to a new state
%c- the propensites that govern our distribution

%Returns a list showing percent of time spent at each state

%Author: Jacob Miller, 4/28/16

function steady_vector=googleRank(F,varF,nv,c,p,pp)

n=length(nv);
%Find transition matrix for network with propensities of c
p_A = multistateA(F,varF,nv,c,p);
P = p_A';

%K is matrix of same size and dimensions of p_A, but every value is 1/p^n
K = (1/p^n)*ones(p^n,p^n);

%Create google matrix
G = pp*P+(1-pp)*K;

%Exponentiate G until each column converges to same values
A=G^50;

%Set return value equal to one column of A
steady_vector=A(1:p^n);
end



