QDpy
Loading...
Searching...
No Matches
milp_portfolio.py File Reference

Joint mixed-integer optimization of high-quality binary portfolios. More...

Go to the source code of this file.

Classes

class  qdpy.algorithms.milp_portfolio.MILPPortfolioResult
 Verified designs and solver outcomes for a near-optimal portfolio. More...

Namespaces

namespace  qdpy

Functions

 qdpy.algorithms.milp_portfolio._joint_model (size, width, rows)
 qdpy.algorithms.milp_portfolio.solve_binary_portfolio (objective, size, *, quality_loss=0., maximize=True, constraints=(), time_limit=None, node_limit=None)
 Find a joint portfolio of distinct binary designs under a quality tolerance.

Detailed Description

Joint mixed-integer optimization of high-quality binary portfolios.

See also
https://cdn.aaai.org/AAAI/2005/AAAI05-059.pdf
https://ijcai.org/proceedings/2015/43

Definition in file milp_portfolio.py.

Function Documentation

◆ _joint_model()

qdpy.algorithms.milp_portfolio._joint_model ( size,
width,
rows )
protected
Create sparse independent design rows and exact XOR distance rows.

Definition at line 78 of file milp_portfolio.py.

◆ solve_binary_portfolio()

qdpy.algorithms.milp_portfolio.solve_binary_portfolio ( objective,
size,
* ,
quality_loss = 0.,
maximize = True,
constraints = (),
time_limit = None,
node_limit = None )

Find a joint portfolio of distinct binary designs under a quality tolerance.

Parameters
objectiveFinite linear objective coefficients for one binary design.
sizeNumber of distinct designs to return, at least two.
quality_lossLargest absolute loss from the single-design optimum.
maximizeWhether higher raw quality is better.
constraintsLinearConstraint objects applied independently to each design.
time_limitOptional positive time limit per solver call, in seconds.
node_limitOptional positive HiGHS node limit per solver call.
Returns
A verified portfolio with termination state and Hamming bound.
First certify the quality reference, then optimize the portfolio jointly.

Both solves request zero relative MIP gap. Constraint verification uses
absolute tolerance 1e-7. Solver certificates retain the solver's
numerical tolerances. Solver calls and their limits apply separately
to the reference optimum and the joint problem.

Definition at line 124 of file milp_portfolio.py.