rgws                   package:sna                   R Documentation

_D_r_a_w _F_r_o_m _t_h_e _W_a_t_t_s-_S_t_r_o_g_a_t_z _R_e_w_i_r_i_n_g _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     'rgws' generates draws from the Watts-Strogatz rewired lattice
     model.  Given a set of input graphs, 'rewire.ws' performs a
     (dyadic) rewiring of those graphs.

_U_s_a_g_e:

     rgws(n, nv, d, z, p)
     rewire.ud(g, p)
     rewire.ws(g, p)

_A_r_g_u_m_e_n_t_s:

       n: the number of draws to take. 

      nv: the number of vertices per lattice dimension. 

       d: the dimensionality of the underlying lattice. 

       z: the nearest-neighbor threshold for local ties. 

       p: the dyadic rewiring probability. 

       g: a graph or graph stack. 

_D_e_t_a_i_l_s:

     A Watts-Strogatz graph process generates a random graph via the
     following procedure.  First, a 'd'-dimensional uniform lattice is
     generated, here with 'nv' vertices per dimension (i.e., 'nv^d'
     vertices total).  Next, all 'z' neighbors are connected, based on
     geodesics of the underlying lattice.  Finally, each non-null dyad
     in the resulting augmented lattice is "rewired" with probability
     'p', where the rewiring operation exchanges the initial dyad state
     with the state of a uniformly selected null dyad sharing exactly
     one endpoint with the original dyad.  (In the standard case, this
     is equivalent to choosing an endpoint of the dyad at random, and
     then transferring the dyadic edges to/from that endpoint to
     another randomly chosen vertex.  Hence the "rewiring" metaphor.) 
     For 'p==0', the W-S process generates (deterministic) uniform
     lattices, approximating a uniform G(N,M) process as 'p' approaches
     1.  Thus, 'p' can be used to tune overall entropy of the process. 
     A well-known property of the W-S process is that (for large 'nv^d'
     and small 'p') it generates draws with short expected mean
     geodesic distances (approaching those found in uniform graphs)
     while maintaining high levels of local "clustering" (i.e.,
     transitivity).  It has thus been proposed as one potential
     mechanism for obtaining "small world" structures.

     'rgws' produces independent draws from the above process,
     returning them as an adjacency matrix (if 'n==1') or array
     (otherwise).  'rewire.ws', on the other hand, applies the rewiring
     phase of the W-S process to one or more input graphs.  This can be
     used to explore local perturbations of the original graphs,
     conditioning on the dyad census.  'rewire.ud' is similar to
     'rewire.ws', save in that all dyads are eligible for rewiring (not
     just non-null dyads), and exchanges with non-null dyads are
     permitted.  This process may be easier to work with than standard
     W-S rewiring in some cases.

_V_a_l_u_e:

     A graph or graph stack containing draws from the appropriate W-S
     process.

_W_a_r_n_i_n_g:

     Remember that the total number of vertices in the graph is 'nv^d'.
      This can get out of hand _very_ quickly.

_N_o_t_e:

     'rgws' generates non-toroidal lattices; some published work in
     this area utilizes underlying toroids, so users should check for
     this prior to comparing simulations against published results.

_A_u_t_h_o_r(_s):

     Carter T. Butts buttsc@uci.edu

_R_e_f_e_r_e_n_c_e_s:

     Watts, D. and Strogatz, S. (1998).  ``Collective Dynamics of
     Small-world Networks.''  _Nature,_ 393:440-442.

_S_e_e _A_l_s_o:

     'rgnm', 'rgraph'

_E_x_a_m_p_l_e_s:

     #Generate Watts-Strogatz graphs, w/increasing levels of rewiring
     gplot(rgws(1,100,1,2,0))     #No rewiring
     gplot(rgws(1,100,1,2,0.01))  #1
     gplot(rgws(1,100,1,2,0.05))  #5
     gplot(rgws(1,100,1,2,0.1))   #10
     gplot(rgws(1,100,1,2,1))     #100

     #Start with a simple graph, then rewire it
     g<-matrix(0,50,50)
     g[1,]<-1; g[,1]<-1    #Create a star
     gplot(g)
     gplot(rewire.ws(g,0.05))  #5

