bqth29 / simulated-bifurcation-algorithm

Python CPU/GPU implementation of the Simulated Bifurcation (SB) algorithm to solve quadratic optimization problems (QUBO, Ising, TSP, optimal asset allocations for a portfolio, etc.).
MIT License
103 stars 25 forks source link

Knapsack model #29

Closed bqth29 closed 11 months ago

bqth29 commented 11 months ago

πŸ’¬ Pull Request Description

The knapsack model was already implemented in the SB API but it is now accessible directly from the models modules as the other optimization models: sb.models.Knapsack.

Tests have been added to cover the model and the matrix definition of the model was fixed.

βœ”οΈ Check list

Before you open the pull request, make sure the following requirements are met.

πŸš€ New features

The Knapsack model now has a summary property that extends and replaces the content property. It gathers the optimization results and status.

🐞 Bug fixes

A not necessary coefficient was used in the matrix definition of the Knapsack model. It was removed.

πŸ“£ Supplementary information

None.

codecov[bot] commented 11 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Files Coverage Ξ”
src/simulated_bifurcation/models/__init__.py 100.00% <100.00%> (ΓΈ)
src/simulated_bifurcation/models/knapsack.py 100.00% <100.00%> (ΓΈ)
tests/models/test_knapsack.py 100.00% <100.00%> (ΓΈ)

:loudspeaker: Thoughts on this report? Let us know!.