<#/GAPDoc>
<#GAPDoc Label="fan3">
The above methods construct fans from so-called triangulations.
For a given list <Math>R</Math> of lists of integers, a triangulation is a fan
whose ray generators are contained in the given list <Math>R</Math>.
<P/>
A regular triangulation is such a fan, for which all cones are strictly convex.
It is called a fine triangulation, iff all elements of <Math>R</Math> are ray generators of this fan.
<P/>
Above we present two method which make this approach available in NConvex via the package TopcomInterface,
which in turn rests on the program Topcom. Consequently, these methods are only available if the
package TopcomInterface is available. They compute either all of the fine and regular triangulations
or merely just a single such triangulation.
<P/>
As an example inspired from toric geometry, let us use the ray generators of the fan of the resolved
conifold (i.e. the total space of the bundle
). This space is known to allow for two different triangulations.
The code below reproduces this feature.
<#Include Label="triangulations_code">
<#/GAPDoc>
<#GAPDoc Label="fan4">
A star subdivision is a certain way of extending a fan. In toric geometry, its applications include blowups of varieties. The following examples correspond to blowups of the origin of
the 2-dimensional and 3-dimensional affine space, respectively.
<Example><![CDATA[
gap> rays := [ [ 1,0 ], [ 0,1 ] ];;
gap> max_cones := [ [1,2] ];;
gap> fan_affine2 := Fan( rays, max_cones );;
gap> fan_blowup_affine2 := StarSubdivisionOfIthMaximalCone( fan_affine2, 1 );
<A fan in |R^2>
gap> Length( RaysInMaximalCones( fan_blowup_affine2 ) );
2
gap> rays := [ [ 1,0,0 ], [ 0,1,0 ], [0,0,1] ];;
gap> max_cones := [ [1,2,3] ];;
gap> fan_affine3 := Fan( rays, max_cones );;
gap> fan_blowup_affine3 := StarSubdivisionOfIthMaximalCone( fan_affine3, 1 );
<A fan in |R^3>
gap> Length( RaysInMaximalCones( fan_blowup_affine3 ) );
3
]]></Example>
<Alt Only="LaTeX"><![CDATA[
Let us now find out if the equation $-2+3x+4y-7z=0$ has integer solutions.
]]></Alt>
<Example><![CDATA[
gap> P := PolyhedronByInequalities( [ [ -2, 3, 4, -7 ], -[ -2, 3, 4, -7 ] ] );
<A polyhedron in |R^3 >
gap> L := LatticePointsGenerators( P );
[ [ [ -4, 0, -2 ] ], [ ], [ [ 0, 7, 4 ], [ 1, 1, 1 ] ] ]
]]></Example>
<Alt Only="LaTeX"><![CDATA[
So the solutions set is $\{ [ -4, 0, -2 ]+ t_1*[ 1, 1, 1 ] + t_2*[ 0, 7, 4 ]; t_1,t_2\in\mathbb{Z}\}$.
\newline
We know that $4x + 6y = 3$ does not have any solutions because $gcd(4,6)=2$ does not divide $3$.
]]></Alt>
<Example><![CDATA[
gap> Q := PolyhedronByInequalities( [ [-3, 4, 6 ], [ 3, -4, -6 ] ] );
<A polyhedron in |R^2 >
gap> LatticePointsGenerators( Q );
[ [ ], [ ], [ [ 3, -2 ] ] ]
]]></Example>
<Alt Only="LaTeX"><![CDATA[
Let us solve the folowing linear system
$$2x + 3y = 1\;\mathrm{mod}\;2$$
$$7x + \phantom{3}y = 3\;\mathrm{mod}\;5.$$
which is equivalent to the sytem
$$-1 + 2x + 3y + 2u = 0$$
$$-3 + 7x + \phantom{3}y + 5v = 0$$
]]></Alt>
<Example><![CDATA[
gap> P := PolyhedronByInequalities( [ [ -1, 2, 3, 2, 0 ], [ -3, 7, 1, 0, 5 ],
> [ 1, -2, -3, -2, 0 ], [ 3, -7, -1, 0, -5 ] ] );
<A polyhedron in |R^4 >
gap> L := LatticePointsGenerators( P );
[ [ [ -19, 1, 18, 27 ] ], [ ], [ [ 0, 10, -15, -2 ], [ 1, -2, 2, -1 ] ] ]
]]></Example>
<Alt Only="LaTeX"><![CDATA[
I.e., the solutions set is
$$\{[-19, 1] + t_1*[1, -2] + t_2*[ 0, 10]; t_1,t_2\in\mathbb{Z}\}$$
]]></Alt>
<#/GAPDoc>
<#GAPDoc Label="linear_program">
<Math>\newline</Math>
To illustrate the using of this operation, let us solve the linear program:
<Math>\\P(x,y)= 1-2x+5y</Math>, with <Math>\newline</Math>
<Math>100\leq x \leq 200 \newline</Math>
<Math>80\leq y\leq 170 \newline</Math>
<Math>y \geq -x+200\newline\newline</Math>
We bring the inequalities to the form <Math>b+AX\geq 0</Math>, we get:
<Math>\newline -100+x\geq 0 \newline</Math>
<Math>200-x \geq 0 \newline</Math>
<Math>-80+y \geq 0 \newline</Math>
<Math>170 -y \geq 0 \newline</Math>
<Math>-200 +x+y \geq 0 \newline</Math>
<Example><![CDATA[
gap> P := PolyhedronByInequalities( [ [ -100, 1, 0 ], [ 200, -1, 0 ],
> [ -80, 0, 1 ], [ 170, 0, -1 ], [ -200, 1, 1 ] ] );;
gap> max := SolveLinearProgram( P, "max", [ 1, -2, 5 ] );
[ [ 100, 170 ], 651 ]
gap> min := SolveLinearProgram( P, "min", [ 1, -2, 5 ] );
[ [ 200, 80 ], 1 ]
gap> VerticesOfMainRatPolytope( P );
[ [ 100, 100 ], [ 100, 170 ], [ 120, 80 ], [ 200, 80 ], [ 200, 170 ] ]
]]></Example>
So the optimal solutions are <Math>(x=100,y=170)</Math> with maximal value <Math>p=1-2(100)+5(170)=651</Math> and
<Math>(x=200,y=80)</Math> with minimal value <Math>p=1-2(200)+5(80)=1</Math>.
<Alt Only="LaTeX"><![CDATA[
Let us now find out if the vertices of the polytope defined by the following inequalities:
$$x_2\geq 0,1-x_1-x_2\geq 0,1+x_1-x_2\geq 0.$$
]]></Alt>
<Example><![CDATA[
gap> P := PolytopeByInequalities( [ [ 0, 0, 1 ], [ 1, -1, -1 ], [ 1, 1, -1 ] ] );
<A polytope in |R^2>
gap> Vertices( P );
[ [ -1, 0 ], [ 0, 1 ], [ 1, 0 ] ]
]]></Example>
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.