Following on this thread a bit, I thought it might be fun to compute this Hilbert basis for the specific problem of a, b, c, d = 9, 35, 6, 25
. From this, we can get all possible non-negative solutions - not just the minimum one (but also the minimum one).
We can compute the Hilbert basis using Normaliz, accessed via PyCall and PyNormaliz (the Normaliz.jl package isn’t working afaik):
using PyCall
const PyNormaliz = pyimport("PyNormaliz")
# set up problem from where it was left by generalized inverse approach
v = [4, -1, -4, 1]
Q = [-35 -140 0 0; 9 36 0 0; 0 0 25 100; 0 0 -6 -24]
S = hcat(v, Q) # solution space in ijkl is spanned by S*[n, t1, t2, t3, t4]
# compute Hilbert basis for monoid S*[n, t1, t2, t3, t4] >= 0
C = PyNormaliz.Cone(inequalities = S)
C.Compute("HilbertBasis", "DualMode")
nts = transpose(C.HilbertBasis())
ijkls = collect(eachcol(S*nts))
ns = nts[1,:]
The possible solutions in n and i,j,k,l are then given by ns
and ijkls
:
julia> println.(Ref("n = "), ns, Ref(": ijkl = "), ijkls)
n = 18: ijkl = [2, 0, 3, 0]
n = 62: ijkl = [3, 1, 2, 2]
n = 79: ijkl = [1, 2, 9, 1]
n = 81: ijkl = [9, 0, 1, 3]
n = 105: ijkl = [0, 3, 5, 3]
n = 106: ijkl = [4, 2, 1, 4]
n = 114: ijkl = [1, 3, 19, 0]
n = 125: ijkl = [10, 1, 0, 5]
n = 140: ijkl = [0, 4, 15, 2]
n = 149: ijkl = [1, 4, 4, 5]
n = 150: ijkl = [5, 3, 0, 6]
n = 175: ijkl = [0, 5, 0, 7]
n = 175: ijkl = [0, 5, 25, 1]
n = 210: ijkl = [0, 6, 35, 0]
n = 225: ijkl = [25, 0, 0, 9]
Any solution to ai + bj = ck + dl = n (here for a, b, c, d = 9, 35, 6, 25
) can now be obtained from the non-negative integer span of the above ijkls
.