Gurobi - 解决容量位置问题

问题描述

我正在尝试解决名为 capa 的 OR 数据库中的容量位置问题

OR 文件 here

答案应该是:

public File(String parent,String child) { if (child == null) { throw new NullPointerException(); } if (parent != null) { if (parent.equals("")) { this.path = fs.resolve(fs.getDefaultParent(),fs.normalize(child)); } else { this.path = fs.resolve(fs.normalize(parent),fs.normalize(child)); } } else { this.path = fs.normalize(child); } this.prefixLength = fs.prefixLength(this.path); }

但我发现:

capa 19240822.449 (capacity 8000)

肯定是我的代码有问题...有人可以帮助我吗? 也许我在优化公式上做错了什么……或者在构建我的运输需求上。我真的不知道,因为在我看来它是正确的。

任何帮助将不胜感激...提前致谢

Best objective 3.145815023928e+08

解决方法

解决了我的问题:

m.setObjective(x.prod(setup_cost)+y.prod(shipping_cost),GRB.MINIMIZE)

我正在计算运费的不同价值。