bellman.ford.sp             package:RBGL             R Documentation

_B_e_l_l_m_a_n-_F_o_r_d _s_h_o_r_t_e_s_t _p_a_t_h_s _u_s_i_n_g _b_o_o_s_t _C++

_D_e_s_c_r_i_p_t_i_o_n:

     Algorithm for the single-source shortest paths problem for a graph
     with both positive and negative edge weights.

_U_s_a_g_e:

     bellman.ford.sp(g,start=nodes(g)[1])

_A_r_g_u_m_e_n_t_s:

       g: instance of class graph 

   start: character: node name for start of path 

_D_e_t_a_i_l_s:

     This function interfaces to the Boost graph library C++ routines
     for Bellman-Ford shortest paths.   Choose the appropriate
     algorithm to calculate the shortest path  carefully based on the
     properties of the given graph. See documentation on Bellman-Ford
     algorithm in Boost Graph Library  for more details.

_V_a_l_u_e:

     A list with elements: 

all edges minimized: true if all edges are minimized, false otherwise. 

distance: The vector of distances from 'start' to each node of 'g';
          includes 'Inf' when there is no path from 'start'.

  penult: A vector of indices  (in 'nodes(g)') of predecessors
          corresponding to each node on the path from that node back to
          'start'

   start: The start node that was supplied in the call to
          'bellman.ford.sp'.

_A_u_t_h_o_r(_s):

     Li Long <li.long@isb-sib.ch>

_S_e_e _A_l_s_o:

     'dag.sp', 'dijkstra.sp', 'johnson.all.pairs.sp', 'sp.between'

_E_x_a_m_p_l_e_s:

     dd <- fromGXL(file(system.file("XML/conn2.gxl",package="RBGL"), open="r"))
     bellman.ford.sp(dd)
     bellman.ford.sp(dd,nodes(dd)[2])

