max.flow                package:RBGL                R Documentation

_C_o_m_p_u_t_e _m_a_x _f_l_o_w _f_o_r _a _d_i_r_e_c_t_e_d _g_r_a_p_h

_D_e_s_c_r_i_p_t_i_o_n:

     Compute max flow for a directed graph

_U_s_a_g_e:

     edmunds.karp.max.flow(g, source, sink)
     push.relabel.max.flow(g, source, sink)

_A_r_g_u_m_e_n_t_s:

       g: an instance of the 'graph' class with 'edgemode' "directed"

  source: node name (character) or node number (int) for the source of
          the flow 

    sink: node name (character) or node number (int) for the sink of
          the flow 

_D_e_t_a_i_l_s:

     Given a directed graph G=(V, E) of a single connected component
     with a vertex  'source' and a vertex 'sink'.  Each arc has a
     positive real valued  capacity, currently it's equivalent to the
     weight of the arc.  The flow of the  network is the net flow
     entering the vertex 'sink'. The maximum flow  problem is to
     determine the maximum possible value for the flow to the  'sink'
     and the corresponding flow values for each arc.  See documentation
     on these algorithms in Boost Graph Library for more details.

_V_a_l_u_e:

     A list of 

 maxflow: the max flow from 'source' to 'sink' 

   edges: the nodes of the arcs with non-zero capacities

   flows: the flow values of the arcs with non-zero capacities

_A_u_t_h_o_r(_s):

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

_R_e_f_e_r_e_n_c_e_s:

     Boost Graph Library by Siek et al.

_S_e_e _A_l_s_o:

     'minCut', 'edgeConnectivity'

_E_x_a_m_p_l_e_s:

     g <- fromGXL(file(system.file("XML/dijkex.gxl",package="RBGL"), open="r"))

     ans1 <- edmunds.karp.max.flow(g, "B", "D")
     ans2 <- edmunds.karp.max.flow(g, 3, 2)     # 3 and 2 equivalent to "C" and "B"

     ans3 <- push.relabel.max.flow(g, 2, 4)     # 2 and 4 equivalent to "B" and "D"
     ans4 <- push.relabel.max.flow(g, "C", "B")

