triadCensus             package:GOstats             R Documentation

_T_r_i_a_d _F_u_n_c_t_i_o_n_s

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

     These functions provide some tools for finding triads in an
     undirected graph. A triad is a clique of size 3. The function
     'triadCensus' returns a list of all triads.

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

     triadCensus(graph)
     isTriad(x, y, z, elz, ely)
     reduce2Degreek(graph, k)
     enumPairs(iVec)

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

   graph: An instance of the 'graph' class. 

       k: An integer indicating the minimum degree wanted.

       x: A node

       y: A node

       z: A node

     elz: The edgelist for 'z'

     ely: The edgelist for 'y'

    iVec: A vector of unique values

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

     'enumPairs' takes a vector as input and returns a list of length
     'choose(length(iVec),2)/2' containing all unordered pairs of
     elements.

     'isTriad' takes three nodes as arguments. It is already known that
     'x' has edges to both 'y' and 'z' and we want to determine whether
     these are reciprocated. This is determined by examining 'elz' for
     both 'x' and 'y' and then examining 'ely' for both 'x' and 'z'. 

     'reduce2Degreek' is a function that takes an undirected graph as
     input and removes all nodes of degree less than 'k'. This process
     is iterated until there are no nodes left (an error is thrown) or
     all nodes remaining have degree at least 'k'. The resultant
     subgraph is returned. It is used here because to be in a triad all
     nodes must have degree 2 or more.

     'triadCensus' makes use of the helper functions described above
     and finds all triads in the graph.

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

     A list where each element is a triple indicating the members of
     the triad. Order is not important and all triads are reported in
     alphabetic order.

_N_o_t_e:

     See the graph package, RBGL and Rgraphviz for more details and
     alternatives.

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

     R. Gentleman

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

     ##---- Should be DIRECTLY executable !! ----
     ##-- ==>  Define data, use random,

