# Formulating two non-negative variables without binary and/or big-M

There are two non-negative integer variables $$q$$ and $$p$$, where only one of them can take a positive value. To impose this relation, I write: \begin{align} q &\leq M(1 - y) \tag1 \\ p &\leq M(y) \tag2 \end{align}

where $$y$$ is binary and $$M$$ is a large number.

Is there a better way to model this relation, possibly without binary and/or big-M?

The big-M values need not be the same. You should choose $$M_1$$ in $$(1)$$ to be a small upper bound on $$q$$ and $$M_2$$ in $$(2)$$ to be a small upper bound on $$p$$.
An alternative formulation is $$p q = 0$$, but that is nonlinear.
If your solver supports indicator constraints, you can write the desired implications directly, without specifying big-M: \begin{align} y = 1 &\implies q = 0 \\ y = 0 &\implies p = 0 \end{align} But the solver might just introduce the big-M constraints on your behalf.