similarity              package:igraph              R Documentation

_S_i_m_i_l_a_r_i_t_y _m_e_a_s_u_r_e_s _o_f _t_w_o _v_e_r_t_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions calculates similarity scores for vertices based on
     their connection patterns.

_U_s_a_g_e:

     similarity.jaccard(graph, vids = V(graph), mode = c("all", "out", "in",
           "total"), loops = FALSE) 
     similarity.dice(graph, vids = V(graph), mode = c("all", "out", "in",
           "total"), loops = FALSE)
     similarity.invlogweighted(graph, vids = V(graph),
            mode = c("all", "out", "in", "total"))

_A_r_g_u_m_e_n_t_s:

   graph: The input graph.

    vids: The vertex ids for which the similarity is calculated.

    mode: The type of neighboring vertices to use for the calculation,
          possible values: ''out'', ''in'', ''all''.

   loops: Whether to include vertices themselves in the neighbor sets.

_D_e_t_a_i_l_s:

     The Jaccard similarity coefficient of two vertices is the number
     of common neighbors divided by the number of vertices that are
     neighbors of at least one of the two vertices being considered.
     'similarity.jaccard' calculates the pairwise Jaccard similarities
     for some (or all) of the vertices.

     The Dice similarity coefficient of two vertices is twice the
     number of common neighbors divided by the sum of the degrees of
     the vertices. 'similarity.dice' calculates the pairwise Dice
     similarities for some (or all) of the vertices.

     The inverse log-weighted similarity of two vertices is the number
     of their common neighbors, weighted by the inverse logarithm of
     their degrees. It is based on the assumption that two vertices
     should be considered more similar if they share a low-degree
     common neighbor, since high-degree common neighbors are more
     likely to appear even by pure chance. Isolated vertices will have
     zero similarity to any other vertex. Self-similarities are not
     calculated. See the following paper for more details: Lada A.
     Adamic and Eytan Adar: Friends and neighbors on the Web. Social
     Networks, 25(3):211-230, 2003.

_V_a_l_u_e:

     A 'length(vids)' by 'length(vids)' numeric matrix containing the
     similarity scores.

_A_u_t_h_o_r(_s):

     Tamas Nepusz ntamas@rmki.kfki.hu and Gabor Csardi
     csardi@rmki.kfki.hu for the manual page.

_R_e_f_e_r_e_n_c_e_s:

     Lada A. Adamic and Eytan Adar: Friends and neighbors on the Web.
     _Social Networks_, 25(3):211-230, 2003.

_S_e_e _A_l_s_o:

     'cocitation' and 'bibcoupling'

_E_x_a_m_p_l_e_s:

     g <- graph.ring(5)
     similarity.dice(g)
     similarity.jaccard(g)

