from scipy.optimize import linprog #Define the objective function c = [-1, 4] # minimize -x + 4y #Define the constraints A_u = np.array([[3, 2], [1, 5]]) b_u = np.array([10,10]) #Define the bounds b = (0, 10) # 0 <= x <= 10 #Solve res = linprog(c, A_ub=A_u, b_ub=b_u, bounds=(b,b), integrality=[1,1]) #Print the results print("Objective function: ", res.fun) print("Optimal solution: ", res.x)