ZPolyhedralSet - Maple Help

PolyhedralSets[ZPolyhedralSets]

 ZPolyhedralSet
 construct Z-polyhedral sets

 Calling Sequence ZPolyhedralSet(constraints) ZPolyhedralSet(constraints,vars,opts)

Parameters

 constraints - list or set of linear equations and non-strict inequalities with rational number coefficients vars - (optional) list of the variables in constraints that are regarded as unknowns, ordered in decreasing order opts - (optional) one or more equations of the form keyword = value, where keyword is one of the names parameters, parameterconstraints, or lattice, described below

Options

 • parameters = list of parameter names
 This option can be used to explicitly list the parameters for a parameterized Z-polyhedral set. The default value is the list of all variables occurring in constraints, except those listed in vars; if vars is not specified, its default value is all variables occurring in constraints, so none are regarded as parameters.
 • parameterconstraints = list or set of linear equations and non-strict inequalities with rational number coefficients
 This option can be used to impose conditions on which parameter values are included. The default value is the empty list (impose no restrictions).
 • lattice = lattice object, or list of a matrix and a vector
 This option can be used to specify a lattice other than the default lattice, ${ℤ}^{n}$. The dimension of the lattice should be the sum of the number of unknowns and the number of parameters.

Description

 • A Z-polyhedral set is the intersection of a polyhedral set with an integer lattice. (A Z-polytope is the intersection of a polytope with an integer lattice; a polytope is a bounded polyhedral set.) This command constructs Maple representations of Z-polyhedral sets, possibly with parameters that occur linearly in the defining inequalities.
 • ZPolyhedralSet(constraints) returns the Z-polyhedral set defined by the inequalities in constraints and the lattice ${ℤ}^{n}$, with the unknowns in an arbitrarily chosen order. The order of the variables can impact the efficiency of some algorithms.
 • ZPolyhedralSet(constraints, vars) imposes the given order on the variables. If any names in constraints are not included in vars, they are considered to be parameters. The order for the parameters is then arbitrarily chosen; this can still impact the efficiency of some algorithms, because internally some algorithms translate a parametric Z-polyhedral set to the Z-polyhedral set where all parameters are additional unknowns (ordered after the original unknowns), and the order of those unknowns then impacts efficiency.
 • ZPolyhedralSet(constraints, vars, parameters = params) lists the parameters explicitly, and also specifies an order on the parameters. If vars is omitted, it consists of all variables in constraints not included in params. If vars is specified, then all variables in constraints need to be listed in either vars or params.
 • ZPolyhedralSet(constraints, parameterconstraints = pcs) specifies conditions that involve only the parameters. If the parameters option and vars argument are not given, they default to the variables occurring in pcs and the rest of the variables in constraints, respectively; each ordered arbitrarily.
 • ZPolyhedralSet(constraints, lattice = L) specifies the lattice, L, that is intersected with the polyhedral set. The default lattice is ${ℤ}^{n}$. L can be a Lattice object as described on the Lattice help page. Alternatively, it can be a list consisting of an $n×n$ Matrix and an $n$-dimensional Vector, out of which Maple will construct a Lattice object as described on that same help page.
 • Z-polyhedral sets, or Z-polyhedra, are used to describe the integer points of a polyhedron (or polyhedral set). For more information, see the command IntegerPointDecomposition.
 • Note that a Z-polyhedral set can also be the input of the command IntegerPointDecomposition. In fact, a Z-polyhedral set returned by the command IntegerPointDecomposition has additional algebraic properties that an arbitrary Z-polyhedral set is unlikely to have.  Those algebraic properties are specified in Definition 2 of the first reference listed below.  They imply that such a Z-polyhedral set, say zp, is consistent (that is, has at least one point) and is specializable. This latter property means that if x is the variable of lowest rank in vars and v is a possible value for x (that is, there exists at least one point of zp with v as x-coordinate) then all the points of zp with v as x-coordinate are given by specializing at x=v the constraints of linear inequalities defining zp.
 • A parametric Z-Polyhedral set is a family of Z-polyhedral sets, given by a Z-polyhedral set where, in the defining linear constraints of inequalities, either the matrix or the right-hand side vector, depend linearly on parameters.  This notion is particularly useful in application problems, like parametric integer linear programming, where the feasible region, and thus the optimal solutions, depend on the values of parameters.

Examples

 > $\mathrm{with}\left(\mathrm{PolyhedralSets}\right):$
 > $\mathrm{with}\left(\mathrm{ZPolyhedralSets}\right):$

Create a Z-polyhedron in the three-dimensional space with a system of two linear equations.

 > $\mathrm{eqs}≔\left[7x+12y+31z=17,3x+5y+14z=7\right]$
 ${\mathrm{eqs}}{≔}\left[{7}{}{x}{+}{12}{}{y}{+}{31}{}{z}{=}{17}{,}{3}{}{x}{+}{5}{}{y}{+}{14}{}{z}{=}{7}\right]$ (1)
 > $\mathrm{vars}≔\left[x,y,z\right]$
 ${\mathrm{vars}}{≔}\left[{x}{,}{y}{,}{z}\right]$ (2)
 > $\mathrm{zp}≔\mathrm{ZPolyhedralSet}\left(\mathrm{eqs},\mathrm{vars}\right)$

Apply IntegerPointDecomposition and obtain the integer solutions of that linear system.

 > $\mathrm{dec}≔\mathrm{IntegerPointDecomposition}\left(\mathrm{zp}\right):$
 > $\mathrm{newzp}≔{\mathrm{dec}}_{1}$
 ${\mathrm{newzp}}{≔}\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{x}{=}{-}{13}{}{z}{-}{1}\\ {y}{=}{5}{}{z}{+}{2}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{x}{,}{y}{,}{z}\right]\\ {\text{Parameters}}& {:}& \left[\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{c}{-13}\\ {5}\\ {1}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{-1}\\ {2}\\ {0}\end{array}\right]\right)\end{array}\right\$ (3)

Create a Z-polyhedral set in two-dimensional space with a system of three linear inequalities.

 > $\mathrm{ineqs}≔\left[x+\frac{2y}{3}\le 4,-x+y\le 1,\frac{1x}{11}+\frac{24}{11}\le y\right]$
 ${\mathrm{ineqs}}{≔}\left[{x}{+}\frac{{2}{}{y}}{{3}}{\le }{4}{,}{-}{x}{+}{y}{\le }{1}{,}\frac{{x}}{{11}}{+}\frac{{24}}{{11}}{\le }{y}\right]$ (4)
 > $\mathrm{zp}≔\mathrm{ZPolyhedralSet}\left(\mathrm{ineqs},\left[x,y\right]\right)$

Apply IntegerPointDecomposition and observe that it contains only one integer point.

 > $\mathrm{dec}≔\mathrm{IntegerPointDecomposition}\left(\mathrm{zp}\right)$
 ${\mathrm{dec}}{≔}\left[\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{x}{=}{2}\\ {y}{=}{3}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{x}{,}{y}\right]\\ {\text{Parameters}}& {:}& \left[\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{c}{0}\\ {1}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{2}\\ {0}\end{array}\right]\right)\end{array}\right\\right]$ (5)

Create another Z-polyhedron in two-dimensional space with a system of three linear inequalities.

 > $\mathrm{ineqs}≔\left[x+\frac{2y}{3}\le 4,-x+y\le \frac{7}{8},\frac{1x}{11}+\frac{24}{11}\le y\right]$
 ${\mathrm{ineqs}}{≔}\left[{x}{+}\frac{{2}{}{y}}{{3}}{\le }{4}{,}{-}{x}{+}{y}{\le }\frac{{7}}{{8}}{,}\frac{{x}}{{11}}{+}\frac{{24}}{{11}}{\le }{y}\right]$ (6)
 > $\mathrm{zp}≔\mathrm{ZPolyhedralSet}\left(\mathrm{ineqs},\left[x,y\right]\right)$

Apply IntegerPointDecomposition and observe that it is empty.

 > $\mathrm{res}≔\mathrm{IntegerPointDecomposition}\left(\mathrm{zp}\right)$
 ${\mathrm{res}}{≔}\left[\right]$ (7)

Create another Z-polyhedron in the three-dimensional space with a system of five linear inequalities.

 > $\mathrm{ineqs}≔\left\{0\le x,0\le y,3x+2y\le 12,2x+3y\le 12,-x+y\le 1\right\}$
 ${\mathrm{ineqs}}{≔}\left\{{0}{\le }{x}{,}{0}{\le }{y}{,}{-}{x}{+}{y}{\le }{1}{,}{2}{}{x}{+}{3}{}{y}{\le }{12}{,}{3}{}{x}{+}{2}{}{y}{\le }{12}\right\}$ (8)
 > $\mathrm{zp}≔\mathrm{ZPolyhedralSet}\left(\mathrm{ineqs},\left[x,y\right]\right)$

Plot the polyhedral set defined over the rational numbers by the system ineqs.

 > $p≔\mathrm{PolyhedralSet}\left(\mathrm{ineqs}\right)$
 ${p}{≔}{{}\begin{array}{lll}{\mathrm{Coordinates}}& {:}& \left[{x}{,}{y}\right]\\ {\mathrm{Relations}}& {:}& \left[{-}{y}{\le }{0}{,}{-}{x}{\le }{0}{,}{-}{x}{+}{y}{\le }{1}{,}{x}{+}\frac{{2}{}{y}}{{3}}{\le }{4}{,}{x}{+}\frac{{3}{}{y}}{{2}}{\le }{6}\right]\end{array}$ (9)
 > $\mathrm{PolyhedralSet}:-\mathrm{Plot}\left(p\right)$

Apply IntegerPointDecomposition to zp and obtain the integer solutions of the linear system ineqs

 > $\mathrm{dec}≔\mathrm{IntegerPointDecomposition}\left(\mathrm{zp}\right):$
 > $\mathrm{newzp}≔{\mathrm{dec}}_{1}$
 ${\mathrm{newzp}}{≔}\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{y}{\le }{2}\\ {-}{x}{\le }{0}\\ {-}{y}{\le }{0}\\ {-}{x}{+}{y}{\le }{1}\\ {3}{}{x}{+}{2}{}{y}{\le }{12}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{x}{,}{y}\right]\\ {\text{Parameters}}& {:}& \left[\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{cc}{1}& {0}\\ {0}& {1}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{0}\\ {0}\end{array}\right]\right)\end{array}\right\$ (10)

Create a parametric Z-Polyhedral set with two unknowns and two parameters

 > $\mathrm{ineqs}≔\left[\mathrm{x_1}+3\mathrm{x_2}\le 9-2\mathrm{theta_1}+\mathrm{theta_2},2\mathrm{x_1}+\mathrm{x_2}\le 8+\mathrm{theta_1}-2\mathrm{theta_2},\mathrm{x_1}\le 4+\mathrm{theta_1}+\mathrm{theta_2},-\mathrm{x_1}\le 0,-\mathrm{x_2}\le 0\right]$
 ${\mathrm{ineqs}}{≔}\left[{\mathrm{x_1}}{+}{3}{}{\mathrm{x_2}}{\le }{9}{-}{2}{}{\mathrm{theta_1}}{+}{\mathrm{theta_2}}{,}{2}{}{\mathrm{x_1}}{+}{\mathrm{x_2}}{\le }{8}{+}{\mathrm{theta_1}}{-}{2}{}{\mathrm{theta_2}}{,}{\mathrm{x_1}}{\le }{4}{+}{\mathrm{theta_1}}{+}{\mathrm{theta_2}}{,}{-}{\mathrm{x_1}}{\le }{0}{,}{-}{\mathrm{x_2}}{\le }{0}\right]$ (11)
 > $\mathrm{vars}≔\left[\mathrm{x_1},\mathrm{x_2}\right]$
 ${\mathrm{vars}}{≔}\left[{\mathrm{x_1}}{,}{\mathrm{x_2}}\right]$ (12)
 > $\mathrm{paras}≔\left[\mathrm{theta_1},\mathrm{theta_2}\right]$
 ${\mathrm{paras}}{≔}\left[{\mathrm{theta_1}}{,}{\mathrm{theta_2}}\right]$ (13)
 > $\mathrm{pzp}≔\mathrm{ZPolyhedralSet}\left(\mathrm{ineqs},\mathrm{vars},'\mathrm{parameters}'=\mathrm{paras}\right)$

Apply IntegerPointDecomposition to pzp and obtain necessary and sufficient conditions on the parameters for  pzp to have integer solutions with vars as unknowns

 > $\mathrm{dec}≔\mathrm{IntegerPointDecomposition}\left(\mathrm{pzp}\right)$
 ${\mathrm{dec}}{≔}\left[\left\{\begin{array}{lll}{\text{Relations}}& {:}& \left\{\begin{array}{:}{-}{\mathrm{x_1}}{\le }{0}\\ {-}{\mathrm{x_2}}{\le }{0}\\ {\mathrm{x_1}}{-}{\mathrm{theta_1}}{-}{\mathrm{theta_2}}{\le }{4}\\ {\mathrm{x_2}}{-}{\mathrm{theta_1}}{+}{2}{}{\mathrm{theta_2}}{\le }{8}\\ {3}{}{\mathrm{x_2}}{+}{2}{}{\mathrm{theta_1}}{-}{\mathrm{theta_2}}{\le }{9}\\ {\mathrm{x_1}}{+}{3}{}{\mathrm{x_2}}{+}{2}{}{\mathrm{theta_1}}{-}{\mathrm{theta_2}}{\le }{9}\\ {2}{}{\mathrm{x_1}}{+}{\mathrm{x_2}}{-}{\mathrm{theta_1}}{+}{2}{}{\mathrm{theta_2}}{\le }{8}\end{array}\right\\\ {\text{Variables}}& {:}& \left[{\mathrm{x_1}}{,}{\mathrm{x_2}}\right]\\ {\text{Parameters}}& {:}& \left[{\mathrm{theta_1}}{,}{\mathrm{theta_2}}\right]\\ {\text{ParameterConstraints}}& {:}& \left\{\begin{array}{:}{\mathrm{theta_2}}{\le }{8}\\ {-}{\mathrm{theta_2}}{\le }{5}\\ {-}{\mathrm{theta_1}}{-}{\mathrm{theta_2}}{\le }{4}\\ {-}{\mathrm{theta_1}}{+}{2}{}{\mathrm{theta_2}}{\le }{8}\\ {2}{}{\mathrm{theta_1}}{-}{\mathrm{theta_2}}{\le }{9}\end{array}\right\\\ {\text{Lattice}}& {:}& {\text{ZSpan}}\left(\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {1}\end{array}\right]{,}{,}{,}\left[\begin{array}{c}{0}\\ {0}\\ {0}\\ {0}\end{array}\right]\right)\end{array}\right\\right]$ (14)

References

 Rui-Juan Jing and Marc Moreno Maza. "Computing the Integer Points of a Polyhedron, I: Algorithm." Proceedings of CASC 2017: 225-241, Springer.
 Rui-Juan Jing and Marc Moreno Maza. "Computing the Integer Points of a Polyhedron, II: Complexity Estimates." Proceedings of CASC 2017: 242-256, Springer.
 Rachid Seghir, Vincent Loechner, and Benoı̂t Meister. "Integer affine transformations of parametric Z-polytopes and applications to loop nest optimization." Proceedings of TACO, Vol. 9(2):8:1–8:27, 2012.
 William Pugh. "The omega test: a fast and practical integer programming algorithm for dependence analysis." Proceedings Supercomputing ’91, pp 4–13. ACM, 1991.
 William Pugh. "Counting solutions to presburger formulas: How and why." Proceedings of PLDI, pp 121–134. ACM, 1994.

Compatibility

 • The PolyhedralSets:-ZPolyhedralSets:-ZPolyhedralSet package was introduced in Maple 2023.