Skip to main content
. Author manuscript; available in PMC: 2015 Apr 7.
Published in final edited form as: Simulation. 2014 Apr 1;90(4):460–484. doi: 10.1177/0037549714526947

Algorithm 5.

procedure AddEdge

Input: individual v, layer j.
1 // Determine candidate new neighbors for v.
2 Cjt(v)Vjt\(Njt(v){v}).
3 if Cjt(v)>0 then
4     foreach c in Cjt(v) do
5         Compute the bias due to degree constraints:
aδt(c){e1(dj(v)Njt(v))Njt(u)<dj(u)0otherwise.}
6         Compute the bias due to the bivariate degree distribution:
aχt(v,c)χj=(Njt(v),Njt(v)+,Njt(c),Njt(c)+).
7         Compute the bias due to bivariate attribute distributions:
aβt(c)i=1mβi,j(xi(v),xi(c)).
8         Compute the bias due to triadic closures:
aΔt(c)ζ(wjΔ1)Δjt(v,c)
where Δjt(v,c)=# layer j triangles formed on adding layer j edge (v, c).
9         Compute propensity of edge (v, c) as the product of 4 biases:
wjt(c)aδt(c)aχt(c)aαt(c)aΔt(c).
10         Normalize propensity to obtain a distribution over Cjt(v)::
pjt(c)ωjt(c)cCjt(v)ωjt(c).
11     w := choose from Cjt(v) randomly according to distribution pjt.
12     // Add the layer j edge connecting v to w.
13         Njt(v)Njt(v){(v,w)}