Opened 8 years ago

Last modified 8 years ago

#10805 new Bugs

Bugs: problem in push_relabel_max_flow algorithm when using std::numeric_limits<double>::max() as capacity in some edges

Reported by: Pablo Madoery <madoerypablo@…> Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost 1.55.0 Severity: Problem
Keywords: BGL, push_relabel_max_flow Cc: jewillco@…

Description

I am having trouble using the push_relabel_max_flow algorithm when I put std::numeric_limits<double>::max() as capacity attribute in some edges.

is there a maximum value that I can use as capacities. which ?.

I adjunct an example that reproduces the error:

/home/madoery/boost_1_55_0/boost/graph/push_relabel_max_flow.hpp:750: typename boost::property_traits<CapacityEdgeMap>::value_type boost::push_relabel_max_flow(Graph&, typename boost::graph_traits<Graph>::vertex_descriptor, typename boost::graph_traits<Graph>::vertex_descriptor, CapacityEdgeMap, ResidualCapacityEdgeMap, ReverseEdgeMap, VertexIndexMap) [with Graph = boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, vertexInfo, edgeInfo>, CapacityEdgeMap = boost::adj_list_edge_property_map<boost::bidirectional_tag, double, double&, long unsigned int, edgeInfo, double edgeInfo::*>, ResidualCapacityEdgeMap = boost::adj_list_edge_property_map<boost::bidirectional_tag, double, double&, long unsigned int, edgeInfo, double edgeInfo::*>, ReverseEdgeMap = boost::adj_list_edge_property_map<boost::bidirectional_tag, boost::detail::edge_desc_impl<boost::bidirectional_tag, long unsigned int>, boost::detail::edge_desc_impl<boost::bidirectional_tag, long unsigned int>&, long unsigned int, edgeInfo, boost::detail::edge_desc_impl<boost::bidirectional_tag, long unsigned int> edgeInfo::*>, VertexIndexMap = boost::vec_adj_list_vertex_id_map<vertexInfo, long unsigned int>, typename boost::property_traits<CapacityEdgeMap>::value_type = double, typename boost::graph_traits<Graph>::vertex_descriptor = long unsigned int]: Assertion `algo.is_flow()' failed.

On the other side, http://lists.boost.org/Archives/boost/2011/01/174683.php treats the problem of using double precision as capacity attributes on the edges. Jeremiah Willcock advices to just replace the == and != operations in is_flow (and not < and >) and asks if the code works correctly in that case. I made the replacement but I had to use precision (epsilon) too high (in the order of 0.2, 0.3) to make the BOOST_ASSERT(algo.is_flow()) to pass.

Maybe these are two different problems or not. I am not sure, but they seems to be regarding the same assert that is failing

Attachments (1)

main.cpp (2.1 KB ) - added by Pablo Madoery <madoerypablo@…> 8 years ago.
It makes a graph that have problematic attributes on the esges

Download all attachments as: .zip

Change History (2)

by Pablo Madoery <madoerypablo@…>, 8 years ago

Attachment: main.cpp added

It makes a graph that have problematic attributes on the esges

comment:1 by viboes, 8 years ago

Component: Nonegraph
Owner: set to Jeremiah Willcock
Note: See TracTickets for help on using tickets.