I know JuMP can solve a linear optimization problem under some constraints and maximize an objective function. Is it also possible to get a random choice under some constraints using JuMP? The pseudo-code can be given as:
possible_transition_lists = Vector{NTuple{length(fleet), Int64}}(undef, 0)
for x in Iterators.product(D_feasible_combs...)
check_x_feasibility(x, D) && push!(possible_transition_lists, x)
end
return sample(possible_transition_lists)
When D_feasible_combs
is small, this code works fine. But when it gets bigger, e.g., Iterators.repeated(collect(1:10), 10)
, the complexity grows exponentially. Is there a way to reduce the complexity by using JuMP and treat it as a linear optimization problem? Or is there any more efficient algorithm to solve this problem?