<p>The function takes a list of lists <code class="code">L</code><span class="SimpleMath">\(:=[L_1, L_2, ...]\)</span> where each <span class="SimpleMath">\(L_j\)</span> represents an inequality and returns the polyhedron defined by them. For example the <span class="SimpleMath">\(j\)</span>'th entry \(L_j = [c_j,a_{j1},a_{j2},...,a_{jn}]\) corresponds to the inequality \(c_j+\sum_{i=1}^n a_{ji}x_i \geq 0\).
<p>The input is a polytope <code class="code">P</code> and a cone <code class="code">C</code>. The output is the polyhedron defined by the Minkowski sum <code class="code">P+C</code>.</p>
<p>The input is a list <code class="code">L</code> and a cone <code class="code">C</code>. The output is the polyhedron defined by the Minkowski sum <code class="code">P+C</code> where <code class="code">P</code> is the polytope, i.e., the convex hull, defined by the points <code class="code">L</code>.</p>
<p>The input is a polytope <code class="code">P</code> and a list <code class="code">L</code>. The output is the polyhedron defined by the Minkowski sum <code class="code">P+C</code> where <code class="code">C</code> is the cone defined by the rays <code class="code">L</code>.</p>
<p>The input is a list <code class="code">P</code> and a list <code class="code">C</code>. The output is the polyhedron defined by the Minkowski sum of the polytope defined by <code class="code">P</code> and the cone defined by <code class="code">C</code>.</p>
<p>Returns the integral lattice generators of the polyhedron. The output is a list <span class="SimpleMath">\(L\)</span> of length <span class="SimpleMath">\(3\)</span>. Any integral point in polyhedron can be written as <span class="SimpleMath">\(a+mb+nc\)</span>, where <span class="SimpleMath">\(a\in L[1],b\in L[2],c\in L[3], m\geq 0\)</span>.</p>
<h4>6.4 <span class="Heading">Solving Linear programs</span></h4>
<p>The problem of solving linear programs can be solved in the gap package <code class="code">CddInterface</code>, which is required by <code class="code">NConvex</code>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SolveLinearProgram</code>( <var class="Arg">P</var>, <var class="Arg">max_or_min</var>, <var class="Arg">target_func</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: a list or fail</p>
<p>The input is a polyhedron <code class="code">P</code>, a string <code class="code">max_or_min</code> <span class="SimpleMath">\(\in\)</span> {"max", "min"} and an objective function <code class="code">target_func</code>, which we want to maximize or minimize. If the linear program has an optimal solution, the operation returns a list of two entries, the solution vector and the optimal value of the objective function, otherwise it returns fail.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SolveLinearProgram</code>( <var class="Arg">P</var>, <var class="Arg">max_or_min</var>, <var class="Arg">target_func</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: a list or fail</p>
<p>The input is a polytope <code class="code">P</code>, a string <code class="code">max_or_min</code> <span class="SimpleMath">\(\in\)</span> {"max","min"} and an objective function <code class="code">target_func</code>, which we want to maximize or minimize. If the linear program has an optimal solution, the operation returns a list of two entries, the solution vector and the optimal value of the objective function, otherwise it returns fail.</p>
<p><span class="SimpleMath">\(\newline\)</span> To illustrate the using of this operation, let us solve the linear program: <span class="SimpleMath">\(\\P(x,y)= 1-2x+5y\)</span>, with <span class="SimpleMath">\(\newline\)</span> <span class="SimpleMath">\(100\leq x \leq 200 \newline\)</span> <span class="SimpleMath">\(80\leq y\leq 170 \newline\)</span> <span class="SimpleMath">\(y \geq -x+200\newline\newline\)</span> We bring the inequalities to the form <span class="SimpleMath">\(b+AX\geq 0\)</span>, we get: <span class="SimpleMath">\(\newline -100+x\geq 0 \newline\)</span> <span class="SimpleMath">\(200-x \geq 0 \newline\)</span> <span class="SimpleMath">\(-80+y \geq 0 \newline\)</span> <span class="SimpleMath">\(170 -y \geq 0 \newline\)</span> <span class="SimpleMath">\(-200 +x+y \geq 0 \newline\)</span></p>
<p>So the optimal solutions are <span class="SimpleMath">\((x=100,y=170)\)</span> with maximal value <span class="SimpleMath">\(p=1-2(100)+5(170)=651\)</span> and <span class="SimpleMath">\((x=200,y=80)\)</span> with minimal value <span class="SimpleMath">\(p=1-2(200)+5(80)=1\)</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ SolveEqualitiesAndInequalitiesOverIntergers</code>( <var class="Arg">eqs</var>, <var class="Arg">eqs_rhs</var>, <var class="Arg">ineqs</var>, <var class="Arg">ineqs_rhs</var>[, <var class="Arg">signs</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a list of three matrices</p>
<p>This function produces a basis of the system <var class="Arg">eqs</var> = <var class="Arg">eqs_rhs</var> and <var class="Arg">ineqs</var> >= <var class="Arg">ineqs_rhs</var>. It outputs a list containing three matrices. The first one is a list of points in a polytope, the second is the hilbert basis of a cone. The set of solutions is then the minkowski sum of the polytope generated by the points in the first list and the cone generated by the hilbert basis in the second matrix. The third one is the free part of the solution polyhedron. The optional argument <var class="Arg">signs</var> must be a list of zeros and ones which length is the number of variables. If the ith entry is one, the ith variable must be >= 0. If the entry is 0, the number is arbitraty. Default is all zero.</p>
<p><span class="SimpleMath">\(\newline\)</span> To illustrate the using of this function, let us compute the integers solutions of the system: <span class="SimpleMath">\(\newline3x+5y=8\newline\)</span> <span class="SimpleMath">\(4x-2y\geq 2\newline\)</span> <span class="SimpleMath">\( 3x+y\geq 3\newline\)</span></p>
<p>So the set of all solutions is given by <span class="SimpleMath">\(\{(1,1)+y*(5,-3),y\geq 0\}\)</span> and it has only one positive solution <span class="SimpleMath">\((1,1)\)</span>.</p>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.