PPL Java Language Interface 2.0
parma_polyhedra_library.MIP_Problem Class Reference

A Mixed Integer (linear) Programming problem. More...

Inheritance diagram for parma_polyhedra_library.MIP_Problem:

Public Member Functions

Functions that Do Not Modify the MIP_Problem
native long max_space_dimension ()
native long space_dimension ()
 Returns the space dimension of the MIP problem.
native Variables_Set integer_space_dimensions ()
 Returns a set containing all the variables' indexes constrained to be integral.
native Constraint_System constraints ()
 Returns the constraints .
native Linear_Expression objective_function ()
 Returns the objective function.
native Optimization_Mode optimization_mode ()
 Returns the optimization mode.
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 total size in bytes of the memory occupied by the underlying C++ object.
native boolean OK ()
 Checks if all the invariants are satisfied.
Functions that May Modify the MIP_Problem
native void clear ()
 Resets this to be equal to the trivial MIP problem.
native void add_space_dimensions_and_embed (long m)
 Adds m new space dimensions and embeds the old MIP problem in the new vector space.
native void add_to_integer_space_dimensions (Variables_Set i_vars)
 Sets the variables whose indexes are in set i_vars to be integer space dimensions.
native void add_constraint (Constraint c)
 Adds a copy of constraint c to the MIP problem.
native void add_constraints (Constraint_System cs)
 Adds a copy of the constraints in cs to the MIP problem.
native void set_objective_function (Linear_Expression obj)
 Sets the objective function to obj.
native void set_optimization_mode (Optimization_Mode mode)
 Sets the optimization mode to mode.
Computing the Solution of the MIP_Problem
native boolean is_satisfiable ()
 Checks satisfiability of this.
native MIP_Problem_Status solve ()
 Optimizes the MIP problem.
native void evaluate_objective_function (Generator evaluating_point, Coefficient num, Coefficient den)
 Sets num and den so that $\frac{num}{den}$ is the result of evaluating the objective function on evaluating_point.
native Generator feasible_point ()
 Returns a feasible point for this, if it exists.
native Generator optimizing_point ()
 Returns an optimal point for this, if it exists.
native void optimal_value (Coefficient num, Coefficient den)
 Sets num and den so that $\frac{num}{den}$ is the solution of the optimization problem.

Constructors and Destructor

 MIP_Problem (long dim)
 Builds a trivial MIP problem.
 MIP_Problem (long dim, Constraint_System cs, Linear_Expression obj, Optimization_Mode mode)
 Builds an MIP problem having space dimension dim from the constraint system cs, the objective function obj and optimization mode mode.
 MIP_Problem (MIP_Problem y)
 Builds a copy of y.
native void free ()
 Releases all resources managed by this, also resetting it to a null reference.
native void finalize ()
 Releases all resources managed by this.

Querying/Setting Control Parameters

native Control_Parameter_Value get_control_parameter (Control_Parameter_Name name)
 Returns the value of control parameter name.
native void set_control_parameter (Control_Parameter_Value value)
 Sets control parameter value.

Additional Inherited Members

Protected Member Functions inherited from parma_polyhedra_library.PPL_Object
 PPL_Object ()
 Builds an object that points to `null'.

Detailed Description

A Mixed Integer (linear) Programming problem.

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

  • the dimension of the vector space;
  • the feasible region, by means of a finite set of linear equality and non-strict inequality constraints; strict rows over declared integer support are stored in equivalent closed form;
  • the subset of the unknown variables that range over the integers (the other variables implicitly ranging over the reals);
  • the objective function, described by a Linear_Expression;
  • the optimization mode (either maximization or minimization).

The class provides support for the (incremental) solution of the MIP problem based on variations of the revised simplex method and on branch-and-bound techniques. The result of the resolution process is expressed in terms of an enumeration, encoding the feasibility and the unboundedness of the optimization problem. The class supports simple feasibility tests (i.e., no optimization), as well as the extraction of an optimal (resp., feasible) point, provided the MIP_Problem is optimizable (resp., feasible).

By exploiting the incremental nature of the solver, it is possible to reuse part of the computational work already done when solving variants of a given MIP_Problem: currently, incremental resolution supports the addition of space dimensions, the addition of constraints, the change of objective function and the change of optimization mode.

Explicit release and finalization clear the native handle and are idempotent. Native access through a released handle, and copying a null or released problem, raise Invalid_Argument_Exception. Argument conversion may invoke Java callbacks; native access checks the receiver after those callbacks return.

Constructor & Destructor Documentation

◆ MIP_Problem() [1/3]

parma_polyhedra_library.MIP_Problem.MIP_Problem ( long dim)
inline

Builds a trivial MIP problem.

A trivial MIP problem requires to maximize the objective function $0$ on a vector space under no constraints at all: the origin of the vector space is an optimal solution.

Parameters
dimThe dimension of the vector space enclosing this.
Exceptions
Length_Error_ExceptionThrown if dim exceeds max_space_dimension().

◆ MIP_Problem() [2/3]

parma_polyhedra_library.MIP_Problem.MIP_Problem ( long dim,
Constraint_System cs,
Linear_Expression obj,
Optimization_Mode mode )
inline

Builds an MIP problem having space dimension dim from the constraint system cs, the objective function obj and optimization mode mode.

Parameters
dimThe dimension of the vector space enclosing this.
csThe constraint system defining the feasible region.
objThe objective function.
modeThe optimization mode.
Exceptions
Length_Error_ExceptionThrown if dim exceeds max_space_dimension().
Invalid_Argument_ExceptionThrown if the constraint system contains a strict inequality depending on continuous coordinates or if the space dimension of the constraint system (resp., the objective function) is strictly greater than dim.

◆ MIP_Problem() [3/3]

parma_polyhedra_library.MIP_Problem.MIP_Problem ( MIP_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.MIP_Problem.max_space_dimension ( )

Returns the maximum space dimension admitted by this Java interface. The result is the smaller of the native MIP_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 MIP_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.MIP_Problem.space_dimension ( )

Returns the space dimension of the MIP problem.

Returns
The space dimension of the MIP problem.

◆ integer_space_dimensions()

native Variables_Set parma_polyhedra_library.MIP_Problem.integer_space_dimensions ( )

Returns a set containing all the variables' indexes constrained to be integral.

Returns
A set containing all the variables' indexes constrained to be integral.

◆ constraints()

native Constraint_System parma_polyhedra_library.MIP_Problem.constraints ( )

Returns the constraints .

Returns
The constraints .

◆ objective_function()

native Linear_Expression parma_polyhedra_library.MIP_Problem.objective_function ( )

Returns the objective function.

Returns
The objective function.

◆ optimization_mode()

native Optimization_Mode parma_polyhedra_library.MIP_Problem.optimization_mode ( )

Returns the optimization mode.

Returns
The optimization mode.

◆ ascii_dump()

native String parma_polyhedra_library.MIP_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.MIP_Problem.toString ( )

Returns a string representation of this.

Returns
A string representation of this.

◆ total_memory_in_bytes()

native long parma_polyhedra_library.MIP_Problem.total_memory_in_bytes ( )

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

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

◆ OK()

native boolean parma_polyhedra_library.MIP_Problem.OK ( )

Checks if all the invariants are satisfied.

Returns
true if the checked representation invariants hold; false otherwise.

◆ clear()

native void parma_polyhedra_library.MIP_Problem.clear ( )

Resets this to be equal to the trivial MIP problem.

The space dimension is reset to $0$.

◆ add_space_dimensions_and_embed()

native void parma_polyhedra_library.MIP_Problem.add_space_dimensions_and_embed ( long m)

Adds m new space dimensions and embeds the old MIP problem in the new vector space.

Parameters
mThe number of dimensions to add.
Exceptions
Length_Error_ExceptionThrown if adding m new space dimensions would cause the vector space to exceed dimension max_space_dimension().

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

◆ add_to_integer_space_dimensions()

native void parma_polyhedra_library.MIP_Problem.add_to_integer_space_dimensions ( Variables_Set i_vars)

Sets the variables whose indexes are in set i_vars to be integer space dimensions.

Exceptions
Invalid_Argument_ExceptionThrown if some index in i_vars does not correspond to a space dimension in this.
Parameters
i_varsThe dimensions constrained to have integer values.

◆ add_constraint()

native void parma_polyhedra_library.MIP_Problem.add_constraint ( Constraint c)

Adds a copy of constraint c to the MIP problem.

Exceptions
Invalid_Argument_ExceptionThrown if the constraint c depends strictly on a continuous coordinate 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.MIP_Problem.add_constraints ( Constraint_System cs)

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

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

◆ set_objective_function()

native void parma_polyhedra_library.MIP_Problem.set_objective_function ( Linear_Expression obj)

Sets the objective function to obj.

Exceptions
Invalid_Argument_ExceptionThrown if the space dimension of obj is strictly greater than the space dimension of this.
Parameters
objThe linear objective function to optimize.

◆ set_optimization_mode()

native void parma_polyhedra_library.MIP_Problem.set_optimization_mode ( Optimization_Mode mode)

Sets the optimization mode to mode.

Parameters
modeThe operation or rounding mode to select.

◆ is_satisfiable()

native boolean parma_polyhedra_library.MIP_Problem.is_satisfiable ( )

Checks satisfiability of this.

Returns
true if and only if the MIP problem is satisfiable.

◆ solve()

native MIP_Problem_Status parma_polyhedra_library.MIP_Problem.solve ( )

Optimizes the MIP problem.

Returns
An MIP_Problem_Status flag indicating the outcome of the optimization attempt (unfeasible, unbounded or optimized problem).

◆ evaluate_objective_function()

native void parma_polyhedra_library.MIP_Problem.evaluate_objective_function ( Generator evaluating_point,
Coefficient num,
Coefficient den )

Sets num and den so that $\frac{num}{den}$ is the result of evaluating the objective function on evaluating_point.

Parameters
evaluating_pointThe point on which the objective function will be evaluated.
numOn exit will contain the numerator of the evaluated value.
denOn exit will contain the denominator of the evaluated value.
Exceptions
Invalid_Argument_ExceptionThrown if this and evaluating_point are dimension-incompatible or if the generator evaluating_point is not a point.

◆ feasible_point()

native Generator parma_polyhedra_library.MIP_Problem.feasible_point ( )

Returns a feasible point for this, if it exists.

Exceptions
Domain_Error_ExceptionThrown if the MIP problem is not satisfiable.
Returns
A feasible point for this, if it exists.

◆ optimizing_point()

native Generator parma_polyhedra_library.MIP_Problem.optimizing_point ( )

Returns an optimal point for this, if it exists.

Exceptions
Domain_Error_ExceptionThrown if this doesn't not have an optimizing point, i.e., if the MIP problem is unbounded or not satisfiable.
Returns
An optimal point for this, if it exists.

◆ optimal_value()

native void parma_polyhedra_library.MIP_Problem.optimal_value ( Coefficient num,
Coefficient den )

Sets num and den so that $\frac{num}{den}$ is the solution of the optimization problem.

Exceptions
Domain_Error_ExceptionThrown if this doesn't not have an optimizing point, i.e., if the MIP problem is unbounded or not satisfiable.
Parameters
numThe rational numerator.
denThe rational denominator.

◆ get_control_parameter()

native Control_Parameter_Value parma_polyhedra_library.MIP_Problem.get_control_parameter ( 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_control_parameter()

native void parma_polyhedra_library.MIP_Problem.set_control_parameter ( Control_Parameter_Value value)

Sets control parameter value.

Parameters
valueThe value to assign or inspect.

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