getpath              package:mathgraph              R Documentation

_F_i_n_d _a _P_a_t_h _i_n _a _M_a_t_h_e_m_a_t_i_c_a_l _G_r_a_p_h

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

     Returns a path, if it exists, from the 'start' to the 'end'.

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

     getpath(x, start, end, ...)
     getpath.mathgraph(x, start, end, ...)

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

       x: an object representing a mathematical graph. 

   start: character string or integer giving the starting node. 

     end: character string or integer giving the ending node. 

     ...: generic arguments. 

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

     'getpath' is a generic function with methods for '"mathgraph"',
     '"incidmat"' and '"adjamat"'. The default method converts 'x' to
     class '"incidmat"'.

     'getpath.adjamat' is an implementation of algorithm 2.2 in
     Chachra,  Ghare and Moore (1979) and 'getpath.incidmat' is an
     implementation  of their algorithm 2.3.

     The distinction between non-existent paths and paths of length
     zero may be useful in some situations.

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

     When at least one path exists, a '"mathgraph"' object containing 
     the edges within the first path found;  this may be an empty
     mathgraph if 'start' and 'end' are equal.
      When no path exists, returns 'NULL'.

_N_o_t_e:

     S Poetry, Patrick J. Burns, Section 13.3

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

     Nick Efthymiou

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

     Chachra, V., Ghare, P. M. and Moore, J. M. (1979).  Applications
     of Graph Theory Algorithms. Elvesier North Holland, New York.

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

     'mathgraph', 'incidmat',  'adjamat'

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

     getpath(mathgraph(~ 1:3 / 3:5), 1, 5) # returns a path
     getpath(mathgraph(~ 1:3 / 3:5), 1, 4) # no path, returns NULL
     getpath(mathgraph(~ 1:3 / 3:5), 1, 1) # returns mathgraph()

