Thanks for the tips, I'll have a look.

Hugo


On Fri, Apr 11, 2014 at 11:53 AM, Nathann Cohen <[email protected]>wrote:

> Hello Hugo !
>
> I see, then perhaps this parameter from GLPK has no effect for such short
> times. Did you check whether  they know that it should only be set for
> longer times, I.e. is it mentioned somewhere in their documentation ?
>
> I am answering your message with a mobile phone right now, unfortunately I
> have no working computer at the moment :-)
>
> I do not know how you can access the "best solution it found" at that
> time, if getting the answers with the "get_values" method does not work. It
> depends on the internals of GLPK, and perhaps they do not store the best
> solution when the computations ended because of the time limit. If you need
> a temporary workaround, maybe you can try to set an approximation ratio
> instead of a time limit : the process will stop once the solver has found a
> solution which is not too far away from the optimal one, and in this case I
> remember that the solution can be accessed.
>
> Well. I cannot do much at the moment without a computer, but the key to
> that is probably in the interface between Sage and GLPK, and possibly not
> very hard to solve : if GLPK has the feature, it can usually be exposed in
> Sage very quickly. Try to take a look at file
> sage/numerical/backends/glpk_backend.pyx, this is where everything happens
> and maybe you can solve your problem. And please submit a patch to Sage if
> you find the key to it, this would definitely be useful to others. Have
> fuuuuuun !!!!  Nathann
>
> On Wednesday, 9 April 2014, Hugo Monteiro <[email protected]>
> wrote:
>
>> Hi,
>>
>> Thank you for getting back to me.
>> it seems the problem lies in me using too small times. If I increase it
>> to a few minutes, instead of a few seconds, it then interrupts computation
>> as expected (although I still have to use the timelimit parameter, as the
>> timelimit_intopt still gives an error)
>>
>> My problem now is that I don't know how to access the best valid solution
>> it managed to find within the time it ran.
>>
>> How do you suggest I should proceed?
>>
>> Hugo
>>
>>
>> On Tue, Apr 8, 2014 at 1:27 PM, Nathann Cohen <[email protected]>wrote:
>>
>>> Helloooooooooo !!
>>>
>>> I am trying to use the interface to use the Mixed Integer Programming
>>>> features in Sage. One of the things I would like to do is to limit the
>>>> execution time to a certain number of seconds and return the current best
>>>> valid solution.
>>>>
>>>
>>> This should be possible.
>>>
>>>
>>>> When setting the timelimit parameter to 10 seconds for example and
>>>> checking the value of the parameter afterwards, I can see it has been
>>>> updated, but the program execution ignores the setting and just keeps
>>>> running for a long time.
>>>> I tried setting instead to set the timelimit_intopt parameter to 10000,
>>>> but when I do this, I get "ValueError: This parameter is not available."
>>>> I went to the code to check I was using the correct string and I see
>>>> nothing wrong.
>>>>
>>>> Can someone point me in the right direction?
>>>>
>>>
>>> Can you give a shortest possible example of code that produces this
>>> problem ?
>>>
>>> Nathann
>>>
>>>  --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "sage-support" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/sage-support/F8dWJ_w3Mtg/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/sage-support.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "sage-support" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/sage-support/F8dWJ_w3Mtg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-support/F8dWJ_w3Mtg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to