[sage-support] Re: Integer solutions to an equations system

2010-02-20 Thread Patrick
I realize this is not really an answer to the question, but if you add one more soldier, the problem becomes When my soldiers form 2 collumns there are 0 soldiers left. When my soldiers form 3 collumns there are 0 soldiers left. When my soldiers form 4 collumns there are 0 soldiers left. When my s

[sage-support] Re: Integer solutions to an equations system

2010-02-19 Thread Oscar Lazo
That was was a lot of good feedback! I'll try that thank you all! Oscar -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/

[sage-support] Re: Integer solutions to an equations system

2010-02-18 Thread Harald Schilly
> You can directly use the variable p['soldiers'], which will call p's > internal dictionary. Of course you will have to say > p.set_integer(p['soldier']) to define its type ! ah ok, uhm, i wasn't sure and did the most obvious thing for me. instead of new_variable and set integer, would it be usef

Re: [sage-support] Re: Integer solutions to an equations system

2010-02-18 Thread Nathann Cohen
> This would make a very nice, simple, easy example in the docs! Not to mention the only non-graph-theoretical one ! :-) Nathann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For mor

[sage-support] Re: Integer solutions to an equations system

2010-02-18 Thread Jason Grout
On 02/18/2010 05:56 AM, Nathann Cohen wrote: Hello !!! I just wanted to add one line about this very short patch : http://trac.sagemath.org/sage_trac/ticket/7637 It enables one to define "unique" variables instead of dictionaries, which is sometimes useful, for exemple in this case : Instead o

[sage-support] Re: Integer solutions to an equations system

2010-02-18 Thread Nathann Cohen
Hello !!! I just wanted to add one line about this very short patch : http://trac.sagemath.org/sage_trac/ticket/7637 It enables one to define "unique" variables instead of dictionaries, which is sometimes useful, for exemple in this case : Instead of soldiers = p.new_variable(vtype=p.__INTEGER)

[sage-support] Re: Integer solutions to an equations system

2010-02-18 Thread Harald Schilly
On Feb 18, 10:45 am, Harald Schilly wrote: > wrote: > > How many soldiers are there? > > If you install the cbc or glpk spkg, you can pose this as a MILP and > something like that should work: ok, now i got the solver running and i can test it ;) so, actually it should look like this: sage: p =

[sage-support] Re: Integer solutions to an equations system

2010-02-18 Thread Harald Schilly
On Feb 18, 2:21 am, Oscar Gerardo Lazo Arjona wrote: > How many soldiers are there? > If you install the cbc or glpk spkg, you can pose this as a MILP and something like that should work: sage: p = MixedIntegerLinearProgram(maximization=False) sage: soldiers = p.new_variable()[1] sage: columns =

Re: [sage-support] Re: Integer solutions to an equations system

2010-02-18 Thread Mike Hansen
Hello, On Thu, Feb 18, 2010 at 1:07 AM, Harald Schilly wrote: > On Feb 18, 2:21 am, Oscar Gerardo Lazo Arjona > wrote: >> I have the feeling that this is a >> more profound problem than it appears (finding integer solutions). >> > > ... and I have the feeling that you can do this rather directly

[sage-support] Re: Integer solutions to an equations system

2010-02-18 Thread Harald Schilly
On Feb 18, 2:21 am, Oscar Gerardo Lazo Arjona wrote: > I have the feeling that this is a > more profound problem than it appears (finding integer solutions). > ... and I have the feeling that you can do this rather directly with Sage's CRT_list function, but I'm unable to solve it. H -- To pos