dwavesystems / dimod

A shared API for QUBO/Ising samplers.
https://docs.ocean.dwavesys.com/en/stable/docs_dimod/
Apache License 2.0
124 stars 81 forks source link

Knapsack Generator #1386

Closed k8culver closed 1 month ago

k8culver commented 1 month ago

A knapsack generator that allows for custom values, weights, and capacity to be passed in instead of randomly generating these values.

Updated the old random_knapsack generator to call the new generator and pass in the random values.

Added additional test to check if the shapes of values and weights are equal.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.85%. Comparing base (23c4b52) to head (b9eb56b). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1386 +/- ## ======================================= Coverage 94.85% 94.85% ======================================= Files 98 98 Lines 10439 10447 +8 ======================================= + Hits 9902 9910 +8 Misses 537 537 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.