gpt4 book ai didi

matlab - linprog 可以给出 x 的整数值吗?

转载 作者:太空宇宙 更新时间:2023-11-03 20:26:27 24 4
gpt4 key购买 nike

我有一个 linprog 代码,其目标函数中包含 x1、x2、x3 和 x4。

我得到的结果以以下形式给出值:

 x = 
6.6667
0.0420
0
0

在我尝试建模的情况下,这在物理上没有意义,因为 x 代表特定技术的单位数量,因此例如 0.0420 实际上并不存在。有没有办法“强制”linprog 找到 x 的最佳整数值?

谢谢

最佳答案

这叫做 integer programming通常是 NP-hard。 linprog 没有涵盖它,因为它是一个完全不同且更难的问题。

Here's a related question (but not a duplicate) from Stack Overflow about Integer Programming .

关于matlab - linprog 可以给出 x 的整数值吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11300305/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com