# ArgMax : Variable Domain Error [closed]

I'm attempting to utilize the ArgMax function, but am receiving the error "ArgMax::vdom: Variable domain ... should be either Reals or Integers."

ArgMax[{objective, cons == 1}, assign, {assign} ∈ {0, 1}]

As a quick overview, we have edges denoted $$e_{i,j}$$ in $$\mathbb{R}^3$$, and we want to assign an integer value of 0 or 1 to each such that their sum is at most 1 for each set of edges. So, objective is defined as a set of sets as summations with constant coefficients $$objective = \{\{3e_{\{4, 2, -2\}, \{1, 3, 1\}\}} + 2e_{\{4, 2, -2\}, \{2, 1, 1\}\}}\}, \{7e_{\{5, 3, -1\}, \{-2, 6, -1\}\}} + 6e_{\{5, 3, -1\}, \{-1, 4, -2\}\}}\}\}$$

We also have a set of sets for constraints defined as $$cons = \{\{e_{\{\{4, 2, -2\}, \{1, 3, 1\}\}} + e_{\{\{4, 2, -2\}, \{2, 1, 1\}\}}\}, \{e_{\{\{5, 3, -1\}, \{-2, 6, -1\}\}} + e_{\{\{5, 3, -1\}, \{-1, 4, -2\}\}}\}\}$$.

Lastly, we have the variables defined in $$assign = \{e_{\{\{4, 2, -2\}, \{1, 3, 1\}\}}, e_{\{\{4, 2, -2\}, \{2, 1, 1\}\}}, e_{\{\{5, 3, -1\}, \{-2, 6, -1\}\}}, e_{\{5, 3, -1\}, \{-1, 4, -2\}\}}\}$$.

I'm new to Mathematica, so this may be a trivial fix, but if anyone can point out my error, I would greatly appreciate it.

• Please include expressions for objective in Mathematica format. Is assign a variable? {assign} ∈ {0, 1} is not a legitimate domain for ArgMax Please read the documentation for this function. Jun 9 at 15:27
• Apologies, I'm not sure how you want me to alter the format. Also, assign is a set containing the variables. Jun 9 at 15:44
• You'll generally get better answers on this site if you provide all of the code that you are using, rather than describing what the variables are. Can you include the actual code you're using to define objective, cons, and assign? Jun 9 at 15:47
• There is a large amount of code before this (300-500 lines). I tried to include a snippet of what these sets look like. Jun 9 at 16:10

The error means what it says: the domain of restriction must be either Reals or Integers. But you can also add additional inequalities in your constraints to ensure that the variables are either 0 or 1. Here's an example of how to do this:
ArgMax[{3 x + 5 y + z,

• @AStrugglingProgrammer - And @@ Thread[0 <= varList <= 1] where varList can have as many variables as you need. Jun 9 at 22:10