Say I want to fill a knapsack with as many things as possible. I don't care about what they are, simply the number. But I don't want the total weight to exceed a set limit.
[https://qiskit.org/textbook/ch-applications/qaoa.html#1.-Constructing-Problem-Hamiltonian-]
- Would my cost function be a weighted average of the total weight of a set and the number?
- Would S be the set of weights?
- Would the number of required qubits be log_2(max(S))?
Thanks