lpmethod.m


lpmethod.m


function lpmethod(filename) % Copyright 2021, 狗万app足彩Gurobi Optimization, LLC % %%显示哪个值给出了最短的求解时间。%读取模型fprintf('读取模型%s\n', filename);模型= gurobi_read(文件名);bestTime =正;bestMethod = 1;对于I = 0:4参数。方法=我;Res = gurobi(模型,参数);如果比较字符串(res。status, 'OPTIMAL')最佳方法= i; bestTime = res.runtime; params.TimeLimit = bestTime; end end % Report which method was fastest if bestMethod == -1 fprintf('Unable to solve this model\n'); else fprintf('Solved in %g seconds with Method %d\n', bestTime, bestMethod); end