ncvx icon indicating copy to clipboard operation
ncvx copied to clipboard

'Relax' method not found for Integer problem

Open jamesdvance opened this issue 7 years ago • 1 comments

x = Integer(int(len(df)), M=m)    
objective = sum_squares(x.T*df['calories'].values-cal_req)
prob = Problem(Minimize(objective),constraints)
prob.solve(method="relax")

Error message: ----> 1 res, totals= solve_int_bounded_relax(sample_df,cal,ub_lb_reqs_df, 5, mac_cols, nut_cols )

in solve_int_bounded_relax(df, cal_req, bounded_reqs_df, m, mac_cols, nut_cols) 14 objective = cvx.sum_squares(x.T*df['calories'].values-cal_req) 15 prob = cvx.Problem(cvx.Minimize(objective),constraints) ---> 16 prob.solve(method="relax") 17 18 df['total']= np.asarray(x.value).reshape(-1)

C:\Anaconda3\lib\site-packages\cvxpy\problems\problem.py in solve(self, *args, **kwargs) 204 func_name = kwargs.pop("method", None) 205 if func_name is not None: --> 206 func = Problem.REGISTERED_SOLVE_METHODS[func_name] 207 return func(self, *args, **kwargs) 208 else:

KeyError: 'relax'

jamesdvance avatar Oct 25 '18 11:10 jamesdvance

I'll close this one out in the next PR @SteveDiamond, making more explicit the methods and adding a simple Integer test case.

bettbra avatar Aug 02 '21 19:08 bettbra