How to find single solution for this system of linear inequalities?

I’m trying to solve a set of modular inequalities using JuMP by replacing the modulus with variables m and n. I’ve tried multiple different solvers but they’re all much too slow. I just want to find any singular solution for x within the constraints.

using JuMP
@variables(model, begin
        0<=x<=2^48 - 1, Int
        0<=n[1:9]<=82595524, Int
        0<=m[1:9]<=2^48-1, Int
    end)
@constraints(model, begin
        1966080 <=  x - 3407872*n[1] - 281474976710656*m[1] <= 2031615
        3014667 <=  25214903917x - 3407872*n[2] - 281474976710656*m[2] <= 3080202
        277361452731 <= 281474976710656*m[3] + 3407872*n[3] - 205749139540585x <= 277361518266
        11718083172670 <= 281474976710656*m[4] + 3407872*n[4] - 233752471717045x <= 11718083238205
        49720480812293 <= 281474976710656*m[5] + 3407872*n[5] - 55986898099985x <= 49720480877828
        102626409177792 <= 281474976710656*m[6] + 3407872*n[6] - 120950523281469x <= 102626409243327
        25707281851743 <= 281474976710656*m[7] + 3407872*n[7] - 76790647859193x <= 25707281917278
        25979476925714 <= 281474976710656*m[8] + 3407872*n[8] - 61282721086213x <= 25979476991249
        137139455518281 <= 281474976710656*m[9] + 3407872*n[9] - 128954768138017x <= 137139455583816
    end)

Is there a more efficient way to solve this or a specific solver which would be best for this sort of problem?

JuMP is probably the wrong tool for the job here. Most MILP solvers use Float64 arithmetic, so even if you could solve this, you’re probably going to encounter approximation errors. (For example, solvers allow something like 1.000001 to be “integer”, they don’t work with exact integers.)

Where do the numbers come from, and why are they so large?

1 Like

This is 2^48, so looks like you’re trying to do some arithmetic mod 2^48 explicitly?