geodist                 package:sna                 R Documentation

_F_u_n_d _t_h_e _N_u_m_b_e_r_s _a_n_d _L_e_n_g_t_h_s _o_f _G_e_o_d_e_s_i_c_s _A_m_o_n_g _N_o_d_e_s _i_n _a _G_r_a_p_h

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

     `geodist' uses a BFS to find the number and lengths of geodesics
     between all nodes of `dat'.  Where geodesics do not exist, the
     value in `inf.replace' is substituted for the distance in
     question.

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

     geodist(dat, inf.replace=dim(dat)[2])

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

     dat: An adjacency matrix 

inf.replace: The value to use for geodesic distances between
          disconnected nodes; by default, this is equal to one greater
          than the maximum path length 

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

     This routine is used by a variety of other functions; many of
     these will allow the user to provide manually precomputed
     `geodist' output so as to prevent expensive recomputation.  Note
     that the choice of one greater than the maximum path length for
     disconnected vertex pairs is non-canonical, and some may prefer to
     simply treat these as missing values.  `geodist' (without loss of
     generality) treats all paths as directed, a fact which should be
     kept in mind when interpreting `geodist' output.

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

     A data frame containing:

  counts: A matrix containing the number of geodesics between each pair
          of vertices

   sigma: A matrix containing the geodesic distances between each pair
          of vertices

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

     Carter T. Butts ctb@andrew.cmu.edu

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

     Brandes, U.  (2000).  ``Faster Evaluation of Shortest-Path Based
     Centrality Indices.'' Konstanzer Schriften in Mathematik und
     Informatik, 120.

     West, D.B.  (1996).  Introduction to Graph Theory.  Upper Saddle
     River, N.J.: Prentice Hall.

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

     `component.dist', `components'

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

     #Find geodesics on a random graph
     gd<-geodist(rgraph(15))

     #Examine the number of geodesics
     gd$counts

     #Examine the geodesic distances
     gd$gdist

