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, 27 Aug 2019 11:11:15 +0200Extremal Rays of a Conehttps://ask.sagemath.org/question/47275/extremal-rays-of-a-cone/Can I use Sage to compute the subspace of a vector space that lies in non-negative real Euclidean space?
For example,
If I compute the nullspace of the matrix,
A =
[ [ 1 0 0 -1 0]
[-1 1 0 0 1]
[ 0 -1 1 0 0]
[ 0 0 -1 1 -1] ]
I get,
[1,1,1,1,0],[0,−1,−1,0,1]
as basis. Now I would like to restrict the solution space to only vectors with non-negative entries. I believe the two basis vectors I am looking for are,
[1,1,1,1,0],[1,0,0,1,1].
My program is written in Python, but I am not sure there is anything written for this sort of problem. Using the simplex method of linear programming (objective function set to zero) only spits out a single solution vector which seems to be the sum of the two I want. I ask here because I see some classes for cones and methods that gives the extremal rays, but it seems I already have to know the extremal rays to use that class.Sun, 28 Jul 2019 00:36:16 +0200https://ask.sagemath.org/question/47275/extremal-rays-of-a-cone/Answer by FrédéricC for <p>Can I use Sage to compute the subspace of a vector space that lies in non-negative real Euclidean space?</p>
<p>For example,</p>
<p>If I compute the nullspace of the matrix, <br>
A = <br>
[ [ 1 0 0 -1 0] <br>
[-1 1 0 0 1] <br>
[ 0 -1 1 0 0] <br>
[ 0 0 -1 1 -1] ] </p>
<p>I get, <br>
[1,1,1,1,0],[0,−1,−1,0,1] <br>
as basis. Now I would like to restrict the solution space to only vectors with non-negative entries. I believe the two basis vectors I am looking for are, <br>
[1,1,1,1,0],[1,0,0,1,1].</p>
<p>My program is written in Python, but I am not sure there is anything written for this sort of problem. Using the simplex method of linear programming (objective function set to zero) only spits out a single solution vector which seems to be the sum of the two I want. I ask here because I see some classes for cones and methods that gives the extremal rays, but it seems I already have to know the extremal rays to use that class.</p>
https://ask.sagemath.org/question/47275/extremal-rays-of-a-cone/?answer=47294#post-id-47294Something like that
sage: P = Polyhedron(rays=[(1,0),(0,1)])
sage: P.intersection(Polyhedron(eqns=[[0,1,-1]]))
A 1-dimensional polyhedron in QQ^2 defined as the convex hull of 1 vertex and 1 ray
Mon, 29 Jul 2019 15:23:36 +0200https://ask.sagemath.org/question/47275/extremal-rays-of-a-cone/?answer=47294#post-id-47294Comment by jipilab for <p>Something like that</p>
<pre><code>sage: P = Polyhedron(rays=[(1,0),(0,1)])
sage: P.intersection(Polyhedron(eqns=[[0,1,-1]]))
A 1-dimensional polyhedron in QQ^2 defined as the convex hull of 1 vertex and 1 ray
</code></pre>
https://ask.sagemath.org/question/47275/extremal-rays-of-a-cone/?comment=47611#post-id-47611Eventually, such cones will be readily constructible. See the ticket: https://trac.sagemath.org/ticket/26623Tue, 27 Aug 2019 11:11:15 +0200https://ask.sagemath.org/question/47275/extremal-rays-of-a-cone/?comment=47611#post-id-47611