Ticket #7728: patchfile.patch
File patchfile.patch, 2.4 KB (added by , 10 years ago) |
---|
-
boykov_kolmogorov_max_flow.hpp
442 442 for(boost::tie(ei, e_end) = out_edges(current_node, m_g); ei != e_end; ++ei){ 443 443 edge_descriptor in_edge = get(m_rev_edge_map, *ei); 444 444 vertex_descriptor other_node = source(in_edge, m_g); 445 if(get_tree(other_node) == tColorTraits::black() && has_parent(other_node)){445 if(get_tree(other_node) == tColorTraits::black() && other_node != m_source){ 446 446 if(get(m_res_cap_map, in_edge) > 0){ 447 447 add_active_node(other_node); 448 448 } 449 if( source(get_edge_to_parent(other_node), m_g) == current_node){449 if(has_parent(other_node) && source(get_edge_to_parent(other_node), m_g) == current_node){ 450 450 //we are the parent of that node 451 451 //it has to find a new parent, too 452 452 set_no_parent(other_node); … … 483 483 for(boost::tie(ei, e_end) = out_edges(current_node, m_g); ei != e_end; ++ei){ 484 484 const edge_descriptor out_edge = *ei; 485 485 const vertex_descriptor other_node = target(out_edge, m_g); 486 if(get_tree(other_node) == tColorTraits::white() && has_parent(other_node)){486 if(get_tree(other_node) == tColorTraits::white() && other_node != m_sink){ 487 487 if(get(m_res_cap_map, out_edge) > 0){ 488 488 add_active_node(other_node); 489 489 } 490 if( target(get_edge_to_parent(other_node), m_g) == current_node){490 if(has_parent(other_node) && target(get_edge_to_parent(other_node), m_g) == current_node){ 491 491 //we were it's parent, so it has to find a new one, too 492 492 set_no_parent(other_node); 493 493 m_child_orphans.push(other_node); … … 526 526 inline void add_active_node(vertex_descriptor v){ 527 527 BOOST_ASSERT(get_tree(v) != tColorTraits::gray()); 528 528 if(get(m_in_active_list_map, v)){ 529 if (m_last_grow_vertex == v) { 530 m_last_grow_vertex = graph_traits<Graph>::null_vertex(); 531 } 529 532 return; 530 533 } else{ 531 534 put(m_in_active_list_map, v, true);