# Reformulating Integer to binary

Hi,

I have an objective function (minimize) Z = 3x* + 2y*

As per the "problem solving handbook" the second step is to reformulate an integer problem to use binary variables.

x and y are integers. How can I convert these to binary?

Any suggestions will be appreciated.

Regards,

## Comments

Sukhraan S(Report)Hi Somankar,

Thank you for reaching out.

In the problem solving handbook you are referring to, there is an illustrative example of a simple map coloring problem which can walk you through a step by step guide on translating integer variables to binary.

If x and y integer variables, are single valued variables which take values from some finite discrete set, DQM (Discrete Quadratic Models) might be a great option, as well. That way you don’t have to translate x and y to binary variables.

Here’s the official documentation containing an example on constructing a DQM:

https://docs.ocean.dwavesys.com/en/stable/docs_dimod/reference/dqm.html

Additional resources for DQM hybrid solver, to solve the DQM problem you construct:

https://support.dwavesys.com/hc/en-us/articles/360057382013-New-Hybrid-Solver-Discrete-Quadratic-Model

Video tutorial: https://youtu.be/rOrvvF-xjD4

Please let me know if you think this will work for your problem. If you'd like, I can also elaborate on the code example or the process for building a DQM problem. I hope this helps!

SOMANKAR B(Report)Thanks. This helps.

Please sign in to leave a comment.