randomNodeGraph            package:graph            R Documentation

_G_e_n_e_r_a_t_e _a _G_r_a_p_h _w_i_t_h _s_p_e_c_i_f_i_e_d _d_e_g_r_e_e _d_i_s_t_r_i_b_u_t_i_o_n.

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

     'randomNodeGraph' generates a random graph with the specified
     degree distribution. Self-loops are allowed. The resultant graph
     is directed (but can always be coerced to be undirected).

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

     randomNodeGraph(nodeDegree)

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

nodeDegree: A named integer vector specifying the node degrees. 

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

     The input vector must be named, the names are taken to be the
     names of the nodes. The sum must be even (there is a theorem that
     says we require that to construct a graph). Self-loops are
     allowed, although patches to the code that make this a switchable
     parameter would be welcome.

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

     An instance of the 'graphNEL' class. The graph is directed.

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

     R. Gentleman

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

     Random Graphs as Models of Networks, M. E. J. Newman.

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

     'randomGraph','randomEGraph'

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

     set.seed(123)
     c1 <- c(1,1,2,4)
     names(c1) <- letters[1:4]

     g1 <- randomNodeGraph(c1)

