Answered
How does one go about devising a penalty formula?
The factoring Jupyter notebook discusses how "the Boolean operations of the gates in our multiplication circuit can be reformulated as penalty functions that penalize invalid states; that is, invalid sets of input and output values representing gates have higher penalty values than valid sets."
For an AND gate, the notebook uses the formula 2ab - 4ac - 4bc + 6c, where a and b are the inputs and c is the output. It's easy to construct a truth table and verify that the formula's value is zero for all valid states and a positive number (2 or 6) for all invalid states.
In general, given a set of logical inputs and outputs and a truth table, how does one go about devising a penalty formula?
Comments
Hi Scott
Thanks for the question. Here a few resources for you:
1/ We have open-source tools for using penalty models - see https://github.com/dwavesystems/penaltymodel
2/ The docs for the above tools are here: https://docs.ocean.dwavesys.com/projects/penaltymodel/en/latest/
3/ And we have some general info on using penalties to reformulate a constraint satisfaction problem (CSP) in our D-Wave system documentation:
https://docs.dwavesys.com/docs/latest/handbook_reformulating.html
See also the two illustrative examples earlier in the same doc, which may help:
https://docs.dwavesys.com/docs/latest/handbook_reformulating.html
Please let us know if this helps,
Hi Fiona,
Thank you for these pointers!
Scott
Please sign in to leave a comment.