If y - x is in [-M_1,M_1] and y - (20 - x) is in [-M_2,M_2] for suitably chosen constants M_1 and M_2, you can linearize the relationship between x and y by introducing a binary variable z and the following constraints:
-M_1 * z <= y - x <= M_1 * z
-M_2 * (1 - z) <= y - (20 - x) <= M_2 * (1 - z)
If z = 0, the first pair of constraints force y = x. If z = 1, the second pair of constraints force y = 20 - x.
Depending on your objective and other constraints, you might be able to avoid the bounds and binary variables. For example, if you want to maximize y, you can just impose y <= x and y <= 20 - x.
... View more