Boost logo

Boost Users :

From: Matthias Linkenheil (m.linkenheil_at_[hidden])
Date: 2005-03-10 12:09:09


Hi,

okay, "ai" is not checked against the end iterator because the assert
function is called.
I don't know how to fix this problem so that the max flow result is right.

Suggestions are welcome?

Thanks,
Matthias Linkenheil

Doug Gregor schrieb:

>
> On Feb 25, 2005, at 4:50 AM, Matthias Linkenheil wrote:
>
>> Hello,
>>
>> I used the edmunds_karp_max_flow algorithm in my project and it
>> worked fine.
>> Then I changed it to the push_relabel_max_flow algorithm but it
>> doesn't work.
>> I get an access violation at line 562 in the push_relabel_max_flow.hpp .
>>
>> Have anyone an idea where the problem could be?
>>
>> Line 558 - line 565 of push_relabel_max_flow.hpp : // do the bottom
>> u = bos;
>> ai = out_edges(u, g).first;
>> while (excess_flow[u] > 0) {
>> if (capacity[*ai] == 0 && is_residual_edge(*ai))
>> push_flow(*ai);
>> ++ai;
>> }
>
>
> That's an odd bit of code... "ai" is never checked against the end
> iterator (out_edges(u, g).second). Could you put in "assert(ai !=
> out_edges(u, g).second);" as the first line of the while loop, to see
> if that's what's happening?
>
> Doug
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net