function  [order] = sequential_netwrok(stacksize,N)
%N: degree
%stack size

m=1;
for i=1:stacksize-1
    for j=i+1:i+N
        if j>stacksize
            continue;
        end
   order(m,1)=i;order(m,2)=j; 
   m=m+1;
    end
end