ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 16 Sep 2014 15:02:01 +0200How to solve linear programming in matrix form?https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/ Some times I have to solve large scale linear programming where the the constraints are given in matrix.
However, all tutorials provided only demonstrate very small scale cases. What if I have a linear programming given in a 1000*400 matrix. How to solve such a linear programming in Sage? Do I need to use another package to solve such linear programming problems?Mon, 15 Sep 2014 15:57:38 +0200https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/Answer by tmonteil for <p>Some times I have to solve large scale linear programming where the the constraints are given in matrix.
However, all tutorials provided only demonstrate very small scale cases. What if I have a linear programming given in a 1000*400 matrix. How to solve such a linear programming in Sage? Do I need to use another package to solve such linear programming problems?</p>
https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/?answer=24139#post-id-24139Did you try anything ? What happens if you input your matrix in the examples given in the tutorial ?
Look at the ``linear_program`` function on [this page](http://www.sagemath.org/doc/reference/numerical/sage/numerical/optimize.html), use ``RDF`` for your floating-point real numbers, and tell us what happens !
Mon, 15 Sep 2014 17:20:04 +0200https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/?answer=24139#post-id-24139Comment by Han for <p>Did you try anything ? What happens if you input your matrix in the examples given in the tutorial ?</p>
<p>Look at the <code>linear_program</code> function on <a href="http://www.sagemath.org/doc/reference/numerical/sage/numerical/optimize.html">this page</a>, use <code>RDF</code> for your floating-point real numbers, and tell us what happens !</p>
https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/?comment=24146#post-id-24146Thank you so much for your suggestions. I went to the page you mentioned above and my problem was well solved.
I would also like to take your answer as a correct answer. However, it seems that the system allows only one correct answer. Even though we already have an <code>linear_program</code> function in sage to solve LP in matrix form. However, to my knowledge, [Dima](http://trac.sagemath.org/ticket/16714) provides an new syntax to solve MILP in matrix form. So let us leave the credit to the real contributors of sage.Tue, 16 Sep 2014 15:02:01 +0200https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/?comment=24146#post-id-24146Answer by Dima for <p>Some times I have to solve large scale linear programming where the the constraints are given in matrix.
However, all tutorials provided only demonstrate very small scale cases. What if I have a linear programming given in a 1000*400 matrix. How to solve such a linear programming in Sage? Do I need to use another package to solve such linear programming problems?</p>
https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/?answer=24140#post-id-24140Using a matrix of constraints has been implemented, and will be released soon (in Sage 6.4).
See http://trac.sagemath.org/ticket/16714
You already might try installing the changes from this ticket into Sage 6.3 and use them. Mon, 15 Sep 2014 17:43:40 +0200https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/?answer=24140#post-id-24140Comment by Han for <p>Using a matrix of constraints has been implemented, and will be released soon (in Sage 6.4).
See <a href="http://trac.sagemath.org/ticket/16714">http://trac.sagemath.org/ticket/16714</a>
You already might try installing the changes from this ticket into Sage 6.3 and use them. </p>
https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/?comment=24143#post-id-24143Thank you so much for all your efforts. Good to know there will be an implement for matrix constraints in MILP. Looking forward to trying the new release of Sage.Tue, 16 Sep 2014 14:18:47 +0200https://ask.sagemath.org/question/24138/how-to-solve-linear-programming-in-matrix-form/?comment=24143#post-id-24143