“时间"的含义指的是“时间".在pyomo的results.json中 [英] Meaning of "Time" in pyomo's results.json

查看:148
本文介绍了“时间"的含义指的是“时间".在pyomo的results.json中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Pyomo和GLPK解决ILP. pyomo在命令行上运行,输出每个步骤花费的时间(以秒为单位).现在,当我查看输出的results.json文件时,我得到的部分看起来像这样:

I am solving an ILP with Pyomo and GLPK. Running on the command line, pyomo outputs the time in seconds it takes for each step. Now, when I look into the results.json file that is output, I get a section that looks like this:

"Solver": [
    {
        "Error rc": 0,
        "Statistics": {
            "Branch and bound": {
                "Number of bounded subproblems": "13",
                "Number of created subproblems": "13"
            }
        },
        "Status": "ok",
        "Termination condition": "optimal",
        "Time": 2.9578073024749756
    }
]

在这种情况下 时间" 是什么意思? 我试图通过应用启发式方法来解决一些变量,以减少求解时间.有趣的是,这不会降低命令行运行时间,但会显着降低results.json文件中的时间值.

What is the meaning of "Time" in this context? I am trying to lower the solving time by applying heuristics to fix some variables. Interestingly, this does not lower the command line running time, but significantly does for the time value in the results.json file.

推荐答案

它对应于在求解器中实际花费的时间.从命令行的角度来看,总时间将包括(1)建立Pyomo模型的时间,(2)将Pyomo模型转换为求解器期望的任何形式的时间(例如LP文件),( 3)在求解器内部花费的时间,以及(4)将求解器解决方案重新加载到Pyomo模型中所花费的时间.

It corresponds to the time actually spent in the solver. Total time, from the view of the command-line, will include (1) the time to build the Pyomo model, (2) the time to translate the Pyomo model into whatever form the solver expects (e.g., an LP file), (3) the time spent inside of the solver, and (4) the time spent loading the solver solution back into the Pyomo model.

随着模型变得非常大,(1)和(2)可能开始变得重要.对于相对简单的模型类(例如LP和有时的MIP),在Cplex和Gurobi之类的工业求解器开始挣扎之前,您可能会遇到Pyomo的瓶颈,但是当出现这种情况时,您可以采取一些措施来降低Pyomo的时间.一个问题.对于较困难的模型类(例如MINLP),在Pyomo(Python)处理时间成为问题之前,您可能会遇到当前求解器功能的限制.

As models become really large, (1) and (2) can start to become significant. For relatively easy model classes (e.g., LP's and sometimes MIPs), you will likely start to hit a bottleneck with Pyomo before industrial solvers like Cplex and Gurobi begin to struggle, but there are steps you can take to lower the Pyomo time when that becomes an issue. For more difficult model classes (e.g., MINLP), you are likely to hit the limitations of current solver capabilities before Pyomo (Python) processing time becomes an issue.

这篇关于“时间"的含义指的是“时间".在pyomo的results.json中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆