Meaning of “Time” in pyomo's results.json

只愿长相守 提交于 2019-12-24 06:58:10

问题


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
    }
]

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:


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.

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.



来源:https://stackoverflow.com/questions/45034035/meaning-of-time-in-pyomos-results-json

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!