PPL Java Language Interface 2.0
parma_polyhedra_library.PIP_Problem Class Reference

A Parametric Integer Programming problem. More...

Inheritance diagram for parma_polyhedra_library.PIP_Problem:

Public Member Functions

 PIP_Problem (long dim)
 Builds a trivial PIP problem.
 PIP_Problem (long dim, Constraint_System cs, Variables_Set params)
 Builds a PIP problem from a sequence of constraints.
 PIP_Problem (PIP_Problem y)
 Builds a copy of y.
native void free ()
 Releases all resources managed by this, also resetting it to a null reference. Existing tree handles become invalid immediately. Repeated calls are harmless.
Functions that Do Not Modify the PIP_Problem
native long max_space_dimension ()
native long space_dimension ()
 Returns the space dimension of the PIP problem.
native long number_of_parameter_space_dimensions ()
 Returns the number of parameter space dimensions of the PIP problem.
native Variables_Set parameter_space_dimensions ()
 Returns all the parameter space dimensions of problem pip.
native long get_big_parameter_dimension ()
 Returns the big parameter dimension of PIP problem pip.
native long number_of_constraints ()
 Returns the number of constraints defining the feasible region of pip.
native Constraint constraint_at_index (long dim)
 Returns the i-th constraint defining the feasible region of the PIP problem pip.
native Constraint_System constraints ()
 Returns the constraints .
native String ascii_dump ()
 Returns an ascii formatted internal representation of this.
native String toString ()
 Returns a string representation of this.
native long total_memory_in_bytes ()
 Returns the size in bytes of the memory occupied by the underlying C++ object.
native long external_memory_in_bytes ()
 Returns the size in bytes of the memory managed by the underlying C++ object.
native boolean OK ()
 Returns true if the pip problem is well formed, i.e., if it satisfies all its implementation invariants; returns false and perhaps makes some noise if broken. Useful for debugging purposes.
Functions that May Modify the PIP_Problem

Once argument conversion and admission checks succeed, entering a native update invalidates all existing tree handles. This includes no-op updates and native updates that subsequently throw.

native void clear ()
 Resets this to be equal to the trivial PIP problem.
native void add_space_dimensions_and_embed (long pip_vars, long pip_params)
 Adds pip_vars + pip_params new space dimensions and embeds the PIP problem in the new vector space.
native void add_to_parameter_space_dimensions (Variables_Set vars)
 Sets the space dimensions in vars to be parameter dimensions of the PIP problem.
native void set_big_parameter_dimension (long d)
 Sets the big parameter dimension of PIP problem to d.
native void add_constraint (Constraint c)
 Adds a copy of constraint c to the PIP problem.
native void add_constraints (Constraint_System cs)
 Adds a copy of the constraints in cs to the PIP problem.
Computing the Solution of the PIP_Problem
native boolean is_satisfiable ()
 Checks satisfiability of this.
native PIP_Problem_Status solve ()
 Optimizes the PIP problem.
native PIP_Tree_Node solution ()
native PIP_Tree_Node optimizing_solution ()

Protected Member Functions

native void finalize ()
 Releases all resources managed by this.
Protected Member Functions inherited from parma_polyhedra_library.PPL_Object
 PPL_Object ()
 Builds an object that points to `null'.

Querying/Setting Control Parameters

native PIP_Problem_Control_Parameter_Value get_pip_problem_control_parameter (PIP_Problem_Control_Parameter_Name name)
 Returns the value of control parameter name.
native void set_pip_problem_control_parameter (PIP_Problem_Control_Parameter_Value value)
 Sets control parameter value.

Detailed Description

A Parametric Integer Programming problem.

An object of this class encodes a parametric integer (linear) programming problem. The PIP problem is specified by providing:

  • the dimension of the vector space;
  • the subset of those dimensions of the vector space that are interpreted as integer parameters (the other space dimensions are interpreted as non-parameter integer variables);
  • a finite set of linear equality and (strict or non-strict) inequality constraints involving variables and/or parameters; these constraints are used to define:
    • the feasible region, if they involve one or more problem variable (and maybe some parameters);
    • the initial context, if they only involve the parameters;
  • optionally, the so-called big parameter, i.e., a problem parameter to be considered arbitrarily big.

Note that all problem variables and problem parameters are assumed to take non-negative integer values, so that there is no need to specify non-negativity constraints.

The native solver treats a designated big parameter as arbitrarily large. Infeasibility under those sign assumptions can coexist with feasibility at smaller finite values. To interpret a solution tree at a finite assignment, satisfy the initial context and the sign assumptions made for the big parameter.

The class provides support for the (incremental) solution of the PIP problem based on variations of the revised simplex method and on Gomory cut generation techniques.

The solution for a PIP problem is the lexicographic minimum of the integer points of the feasible region, expressed in terms of the parameters. As the problem to be solved only involves non-negative variables and parameters, the problem will always be either unfeasible or optimizable.

As the feasibility and the solution value of a PIP problem depend on the values of the parameters, the solution is a binary decision tree, dividing the context parameter set into subsets. The tree nodes are of two kinds:

  • Decision nodes. These are internal tree nodes encoding one or more linear tests on the parameters; if all the tests are satisfied, then the solution is the node's true child; otherwise, the solution is the node's false child;
  • Solution nodes. These are leaf nodes in the tree, encoding the solution of the problem in the current context subset, where each variable is defined in terms of a linear expression of the parameters. Solution nodes also optionally embed a set of parameter constraints: if all these constraints are satisfied, the solution is described by the node, otherwise the problem has no solution.

It may happen that a decision node has no false child. This means that there is no solution if at least one of the corresponding constraints is not satisfied. Decision nodes having two or more linear tests on the parameters cannot have a false child. Decision nodes always have a true child.

Both kinds of tree nodes may also contain the definition of extra parameters which are artificially introduced by the solver to enforce an integral solution. Such artificial parameters are defined by the integer division of a linear expression on the parameters by an integer coefficient.

The problem can be extended with space dimensions, parameters and constraints. Repeated queries on an unchanged problem can reuse the current result. After constraints are appended to a problem with a retained feasible solution tree, the next solve rebuilds the result from the updated model and its parameter context.

Constructor & Destructor Documentation

◆ PIP_Problem() [1/3]

parma_polyhedra_library.PIP_Problem.PIP_Problem ( long dim)
inline

Builds a trivial PIP problem.

A trivial PIP problem requires to compute the lexicographic minimum on a vector space under no constraints and with no parameters: due to the implicit non-negativity constraints, the origin of the vector space is an optimal solution.

Parameters
dimThe dimension of the vector space enclosing this (optional argument with default value $0$).
Exceptions
Length_Error_ExceptionThrown if dim exceeds max_space_dimension().

◆ PIP_Problem() [2/3]

parma_polyhedra_library.PIP_Problem.PIP_Problem ( long dim,
Constraint_System cs,
Variables_Set params )
inline

Builds a PIP problem from a sequence of constraints.

Builds a PIP problem having space dimension dim from the constraint system cs; the dimensions vars are interpreted as parameters.

Parameters
dimThe dimension of the enclosing vector space.
csThe source constraint system used to construct the object.
paramsThe dimensions interpreted as parameters.

◆ PIP_Problem() [3/3]

parma_polyhedra_library.PIP_Problem.PIP_Problem ( PIP_Problem y)
inline

Builds a copy of y.

Parameters
yThe source value used to initialize this object.

Member Function Documentation

◆ max_space_dimension()

native long parma_polyhedra_library.PIP_Problem.max_space_dimension ( )

Returns the maximum space dimension admitted by this Java interface. The result is the smaller of the native PIP_Problem limit and Long.MAX_VALUE, and is always nonnegative. Availability of memory and other resources still limits actual constructions.

Returns
The maximum space dimension admitted by this Java interface. The result is the smaller of the native PIP_Problem limit and Long.MAX_VALUE, and is always nonnegative. Availability of memory and other resources still limits actual constructions.

◆ space_dimension()

native long parma_polyhedra_library.PIP_Problem.space_dimension ( )

Returns the space dimension of the PIP problem.

Returns
The space dimension of the PIP problem.

◆ number_of_parameter_space_dimensions()

native long parma_polyhedra_library.PIP_Problem.number_of_parameter_space_dimensions ( )

Returns the number of parameter space dimensions of the PIP problem.

Returns
The number of parameter space dimensions of the PIP problem.

◆ parameter_space_dimensions()

native Variables_Set parma_polyhedra_library.PIP_Problem.parameter_space_dimensions ( )

Returns all the parameter space dimensions of problem pip.

Returns
All the parameter space dimensions of problem pip.

◆ get_big_parameter_dimension()

native long parma_polyhedra_library.PIP_Problem.get_big_parameter_dimension ( )

Returns the big parameter dimension of PIP problem pip.

Returns
The big parameter dimension of PIP problem pip.

◆ number_of_constraints()

native long parma_polyhedra_library.PIP_Problem.number_of_constraints ( )

Returns the number of constraints defining the feasible region of pip.

Returns
The number of constraints defining the feasible region of pip.

◆ constraint_at_index()

native Constraint parma_polyhedra_library.PIP_Problem.constraint_at_index ( long dim)

Returns the i-th constraint defining the feasible region of the PIP problem pip.

Parameters
dimThe index of the selected element or space dimension.
Returns
The i-th constraint defining the feasible region of the PIP problem pip.

◆ constraints()

native Constraint_System parma_polyhedra_library.PIP_Problem.constraints ( )

Returns the constraints .

Returns
The constraints .

◆ ascii_dump()

native String parma_polyhedra_library.PIP_Problem.ascii_dump ( )

Returns an ascii formatted internal representation of this.

Returns
An ascii formatted internal representation of this.

◆ toString()

native String parma_polyhedra_library.PIP_Problem.toString ( )

Returns a string representation of this.

Returns
A string representation of this.

◆ total_memory_in_bytes()

native long parma_polyhedra_library.PIP_Problem.total_memory_in_bytes ( )

Returns the size in bytes of the memory occupied by the underlying C++ object.

Returns
The size in bytes of the memory occupied by the underlying C++ object.

◆ external_memory_in_bytes()

native long parma_polyhedra_library.PIP_Problem.external_memory_in_bytes ( )

Returns the size in bytes of the memory managed by the underlying C++ object.

Returns
The size in bytes of the memory managed by the underlying C++ object.

◆ OK()

native boolean parma_polyhedra_library.PIP_Problem.OK ( )

Returns true if the pip problem is well formed, i.e., if it satisfies all its implementation invariants; returns false and perhaps makes some noise if broken. Useful for debugging purposes.

Returns
True if the pip problem is well formed, i.e., if it satisfies all its implementation invariants; returns false and perhaps makes some noise if broken. Useful for debugging purposes.

◆ clear()

native void parma_polyhedra_library.PIP_Problem.clear ( )

Resets this to be equal to the trivial PIP problem.

The space dimension is reset to $0$.

◆ add_space_dimensions_and_embed()

native void parma_polyhedra_library.PIP_Problem.add_space_dimensions_and_embed ( long pip_vars,
long pip_params )

Adds pip_vars + pip_params new space dimensions and embeds the PIP problem in the new vector space.

Parameters
pip_varsThe number of space dimensions to add that are interpreted as PIP problem variables (i.e., non parameters). These are added before adding the pip_params parameters.
pip_paramsThe number of space dimensions to add that are interpreted as PIP problem parameters. These are added after having added the pip_vars problem variables.

The new space dimensions will be those having the highest indexes in the new PIP problem; they are initially unconstrained.

Exceptions
Length_Error_ExceptionThrown if the total would exceed max_space_dimension(). This check precedes changes to the problem.

◆ add_to_parameter_space_dimensions()

native void parma_polyhedra_library.PIP_Problem.add_to_parameter_space_dimensions ( Variables_Set vars)

Sets the space dimensions in vars to be parameter dimensions of the PIP problem.

Parameters
varsThe set of space dimensions selected for the operation.

◆ set_big_parameter_dimension()

native void parma_polyhedra_library.PIP_Problem.set_big_parameter_dimension ( long d)

Sets the big parameter dimension of PIP problem to d.

Parameters
dThe index of the selected element or space dimension.

◆ add_constraint()

native void parma_polyhedra_library.PIP_Problem.add_constraint ( Constraint c)

Adds a copy of constraint c to the PIP problem.

Exceptions
Invalid_Argument_ExceptionThrown if the constraint c is a strict inequality or if its space dimension is strictly greater than the space dimension of this.
Parameters
cThe constraint operand.

◆ add_constraints()

native void parma_polyhedra_library.PIP_Problem.add_constraints ( Constraint_System cs)

Adds a copy of the constraints in cs to the PIP problem.

Exceptions
Invalid_Argument_ExceptionThrown if the constraint system cs contains any strict inequality or if its space dimension is strictly greater than the space dimension of this.
Parameters
csThe constraint system operand.

◆ is_satisfiable()

native boolean parma_polyhedra_library.PIP_Problem.is_satisfiable ( )

Checks satisfiability of this.

Returns
true exactly when the solver returns the optimized status in the selected mode.

◆ solve()

native PIP_Problem_Status parma_polyhedra_library.PIP_Problem.solve ( )

Optimizes the PIP problem.

Solves the PIP problem, returning an exit status.

Returns
UNFEASIBLE_PIP_PROBLEM for infeasibility in the selected mode, or OPTIMIZED_PIP_PROBLEM when the solver produces an optimal solution tree.

◆ solution()

native PIP_Tree_Node parma_polyhedra_library.PIP_Problem.solution ( )

Returns a borrowed solution-tree handle for the PIP problem. The handle retains this problem. Problem updates and explicit release invalidate existing handles, including child and typed views; subsequent operations throw Invalid_Argument_Exception. Cached solution queries preserve existing handles. For an infeasible problem, both as_solution() and as_decision() on the returned handle yield null.

Returns
A borrowed solution-tree handle for the PIP problem. The handle retains this problem. Problem updates and explicit release invalidate existing handles, including child and typed views; subsequent operations throw Invalid_Argument_Exception. Cached solution queries preserve existing handles. For an infeasible problem, both as_solution() and as_decision() on the returned handle yield null.

◆ optimizing_solution()

native PIP_Tree_Node parma_polyhedra_library.PIP_Problem.optimizing_solution ( )

Returns an optimizing solution-tree handle, with the ownership and validity contract of solution().

Returns
An optimizing solution-tree handle, with the ownership and validity contract of solution().

◆ get_pip_problem_control_parameter()

native PIP_Problem_Control_Parameter_Value parma_polyhedra_library.PIP_Problem.get_pip_problem_control_parameter ( PIP_Problem_Control_Parameter_Name name)

Returns the value of control parameter name.

Parameters
nameThe name used in the diagnostic or textual representation.
Returns
The value of control parameter name.

◆ set_pip_problem_control_parameter()

native void parma_polyhedra_library.PIP_Problem.set_pip_problem_control_parameter ( PIP_Problem_Control_Parameter_Value value)

Sets control parameter value.

Parameters
valueThe parametric integer programming problem operand.

The documentation for this class was generated from the following file:
  • PIP_Problem.java