English
Languages
English
Bengali
Japanese
Shortcuts



BinPacking

class BinPacking(weights, max_weight, max_number_of_bins=None)[source]

Bases: OptimizationApplication

Optimization application for the “bin packing” [1] problem.

References

[1]: “Bin packing”, https://en.wikipedia.org/wiki/Bin_packing_problem

Parameters
  • weights (List[int]) – A list of the weights of items

  • max_weight (int) – The maximum bin weight capacity

  • max_number_of_bins (Optional[int]) – The maximum number of bins by default equal to the number of items

Methods

get_figure(result)

Get plot of the solution of the Bin Packing Problem.

interpret(result)

Interpret a result as item indices

to_quadratic_program()

Convert a bin packing problem instance into a QuadraticProgram