Error Messages/9323

Example error messages

An integer group (specified by setting «ctype» to 'G' in LpDefine) must contain at least two decision variables.


In the optimization problem that you have defined, you have specified the decision variable type («ctype» or «intType») of a variable as grouped-integer. For example, in LpDefine, QpDefine or NlpDefine you have specified the «ctype» parameter and set the «ctype» of at least one of the variables to 'G'. You may have done this to only a single decision variable. This would imply that this variable is constrained to be 1, but more likely it probably means you made a mistake in your formulation, so the optimizer reports an error. Grouped-integer variables are not real useful unless you assign 2 or more decision variables to the same group.

You may have also specified the «group» parameter to assign the decision variable to a specific group. In this case, it is possible that you've set the «ctype» of several variables to 'G', but there is at least one assigned group that has only a single decision variable assigned to it.


In most cases, the error will clue you into a mistake in your problem formulation, since it is unlikely that you intended to define a group with only a single variable.

There are cases where you might not have an error in your problem formulation. For example, your set of decision variables might be determined by various input parameters, and in certain degenerate cases a particular group may end up with a single element. If that is the case, you'll have to introduce some extra logic. The parameter passed to «ctype» will need to be computed, and you'll have to create the expression to detect when there is only a single member of a group. For those solitary variables, you'll have to specify something other than 'G' (any of 'C', 'I' or 'B' will work). Then use the same logic to specify the «lb» and «ub» for that decision variable to be 1.

See Also


You are not allowed to post comments.