For the new code you sent that allows for <= constraints. In the section where you adjust for nonzero lower bounds on arcs (_have_lower), you only adjust the _supply. Don't you have to adjust _supply_up as well?<br>
<br><br><br><br><br><br><div class="gmail_quote">2010/7/28 Kovács Péter <span dir="ltr"><<a href="mailto:kpeter@inf.elte.hu">kpeter@inf.elte.hu</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Dear Matt,<br>
<br>
I see your problem, a more general support could be implemented to NS. Unfortunatelly, I don't have enough time to do it at the moment, but I will try to find some time for that.<br>
<br>
With the current solution, you should consider a certain finite value as infinite. E.g. using 'long long int' value type, numeric_limits<long long int>::max()/number_of_nodes could be a good choice, it wouldn't cause overflow problems inside NS.<br>
<br>
Regards,<br>
Peter<br>
<br>
<br>
2010.07.27. 22:15 keltezéssel, Matthew Galati írta:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
I have an interesting case that I am not sure how to handle with the<br>
current solver.<br>
<br>
It is a graph with one arc and 2 nodes. The arc goes from node 1 to 0.<br>
Both nodes have supply=0, but one is a >= and one is a <=.<br>
<br>
That is,<br>
<br>
supply_lb[0] = -infinity<br>
supply_ub[0] = 0<br>
<br>
supply_lb[1] = 0<br>
supply_ub[1] = infinity<br>
<br>
The arc(1-0) has no capacity (infinite) and cost=58.0.<br>
<br>
So, I have no way to easily bound supply_lb[0] to a finite value.<br>
<br>
How can I handle this case?<br>
<br>
Thanks,<br>
Matt<br>
<br>
<br></div>
2010/7/20 Kovács Péter <<a href="mailto:kpeter@inf.elte.hu" target="_blank">kpeter@inf.elte.hu</a> <mailto:<a href="mailto:kpeter@inf.elte.hu" target="_blank">kpeter@inf.elte.hu</a>>><div><div></div><div class="h5">
<br>
<br>
Dear Matt,<br>
<br>
"Infinite" means std::numeric_limits<Number>::max() or<br>
std::numeric_limits<Numer>::infinity() (if it exists). You can use<br>
any "small enough" negative finite value. Such a value could be<br>
found relatively easily in most cases. E.g. the negative of the sum<br>
of all arc capacities is surely suitable, if it does not cause<br>
overflow problems. Otherwise you can use another value or a larger<br>
number type (e.g. long long int or double).<br>
<br>
Of course, a better support could be impleneted that correctly<br>
handles negative infinite bounds, but the current solution is based<br>
on the GEQ formulation, so it requires finite lower bounds.<br>
<br>
Regards,<br>
Peter<br>
<br>
2010.07.20. 14:44 keltezéssel, Matthew Galati írta:<br>
<br>
Hi Again,<br>
<br>
It states in the ticket that infinite lower bounds are not<br>
supported for<br>
supply nodes. Does this mean that LEQ constraints are not<br>
supported? Is<br>
there any workaround for this? I currently have examples where I<br>
have<br>
both LEQ,GEQ and EQ constraints. I cannot just "flip" the LEQ to<br>
GEQ,<br>
because this would break the network structure (+1/-1). Any<br>
workarounds?<br>
<br>
Since LEQ-GEQ constraints are allowed (when both are finite) -<br>
is there<br>
some "big enough" finite value for the supply lower bound than<br>
can be<br>
used to represent infinity and have it still work?<br>
<br>
Thanks,<br>
Matt<br>
<br>
However, I made a working solution for the lower-upper bound<br>
formulation. I attached a patch to the corresponding ticket:<br>
<br>
<a href="http://lemon.cs.elte.hu/trac/lemon/ticket/375" target="_blank">http://lemon.cs.elte.hu/trac/lemon/ticket/375</a><br>
I also attached the modified files to this letter for the sake<br>
of simplicity.<br>
<br>
This version of NS can solve your problem with GEQ and EQ supply<br>
constraints. For a GEQ node, you should use sufficiently large<br>
(or infinite) upper bound and for an EQ node, you should use the<br>
same value for lower and upper bound.<br>
<br>
I hope this solution helps you in your work.<br>
<br>
Best regards,<br>
Peter<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div></div></blockquote>
<br>
</blockquote></div><br>