traits                package:igraph                R Documentation

_G_r_a_p_h _g_e_n_e_r_a_t_i_o_n _b_a_s_e_d _o_n _d_i_f_f_e_r_e_n_t _v_e_r_t_e_x _t_y_p_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions implement evolving network models based on
     different vertex types.

_U_s_a_g_e:

     callaway.traits.game (nodes, types, edge.per.step = 1, type.dist = rep(1, 
         types), pref.matrix = matrix(1, types, types), directed = FALSE) 
     establishment.game(nodes, types, k = 1, type.dist = rep(1, types),
         pref.matrix = matrix(1, types, types), directed = FALSE) 

_A_r_g_u_m_e_n_t_s:

   nodes: The number of vertices in the graph.

   types: The number of different vertex types.

edge.per.step: The number of edges to add to the graph per time step.

type.dist: The distribution of the vertex types. This is assumed to be
          stationary in time.

pref.matrix: A matrix giving the preferences of the given vertex types.
          These should be probabilities, ie. numbers between zero and
          one.

directed: Logical constant, whether to generate directed graphs.

       k: The number of trials per time step, see details below.

_D_e_t_a_i_l_s:

     For 'callaway.traits.game' the simulation goes like this: in each
     discrete time step a new vertex is added to the graph. The type of
     this vertex is generated based on 'type.dist'. Then two vertices
     are selected uniformly randomly from the graph. The probability
     that they will be connected depends on the types of these vertices
     and is taken from 'pref.matrix'. Then another two vertices are
     selected and this is repeated 'edges.per.step' times in each time
     step.

     For 'establishment.game' the simulation goes like this: a single
     vertex is added at each time step. This new vertex tries to
     connect to 'k' vertices in the graph. The probability that such a
     connection is realized depends on the types of the vertices
     involved and is taken from 'pref.matrix'.

_V_a_l_u_e:

     A new graph object.

_A_u_t_h_o_r(_s):

     Gabor Csardi csardi@rmki.kfki.hu

_E_x_a_m_p_l_e_s:

     # two types of vertices, they like only themselves
     g1 <- callaway.traits.game(1000, 2, pref.matrix=matrix( c(1,0,0,1), nc=2))
     g2 <- establishment.game(1000, 2, k=2, pref.matrix=matrix( c(1,0,0,1), nc=2))

