SCIP使用详解(一)

国内的SCIP用的少,看英文太难受了,翻译在这里用于备份,转载请注明来源
SCIP官网:https://www.scipopt.org/index.php#welcome

概述

什么是SCIP?

SCIP是一个用于解决约束整数规划(CIP)和混合整数非线性规划的框架。特别的,SCIP结合了混合整数规划(MIP)求解器和基于LP的混合整数非线性规划(MINLP)求解器,是一个分支减界定价的框架。

快速开始

让我们从下面这个LP的小例子开始。具有一个通用整数变量和三个线性约束的4变量问题

Maximize
 obj: x1 + 2 x2 + 3 x3 + x4
Subject To
 c1: - x1 + x2 + x3 + 10 x4 <= 20
 c2: x1 - 3 x2 + x3 <= 30
 c3: x2 - 3.5 x4 = 0
Bounds
 0 <= x1 <= 40
 2 <= x4 <= 3
General
 x4
End

将该文件另存为"simple.lp" ,并读入SCIP解决

scip -c "read simple.lp optimize quit"

结果

SCIP version 7.0.2 [precision: 8 byte] [memory: block] [mode: optimized] [LP solver: SoPlex 5.0.2] [GitHash: ff3084eb02]
Copyright (C) 2002-2020 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)

External codes: 
  Readline 7.0         GNU library for command line editing (gnu.org/s/readline)
  SoPlex 5.0.2         Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de) [GitHash: e24c304e]
  CppAD 20180000.0     Algorithmic Differentiation of C++ algorithms developed by B. Bell (www.coin-or.org/CppAD)
  ZLIB 1.2.11          General purpose compression library by J. Gailly and M. Adler (zlib.net)
  GMP 6.1.2            GNU Multiple Precision Arithmetic Library developed by T. Granlund (gmplib.org)

user parameter file <scip.set> not found - using default parameters


read problem <doc/inc/simpleinstance/simple.lp>
============

original problem has 4 variables (0 bin, 1 int, 0 impl, 3 cont) and 3 constraints

presolving:
(round 1, fast)       2 del vars, 1 del conss, 0 add conss, 4 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
(round 2, fast)       2 del vars, 1 del conss, 0 add conss, 6 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
(round 3, fast)       2 del vars, 1 del conss, 0 add conss, 7 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
   (0.0s) probing cycle finished: starting next cycle
   Deactivated symmetry handling methods, since SCIP was built without symmetry detector (SYM=none).
presolving (4 rounds: 4 fast, 1 medium, 1 exhaustive):
 2 deleted vars, 1 deleted constraints, 0 added constraints, 7 tightened bounds, 0 added holes, 0 changed sides, 0 changed coefficients
 2 implications, 0 cliques
presolved problem has 3 variables (1 bin, 0 int, 0 impl, 2 cont) and 2 constraints
      2 constraints of type <linear>
Presolving Time: 0.00

 time | node  | left  |LP iter|LP it/n|mem/heur|mdpt |vars |cons |rows |cuts |sepa|confs|strbr|  dualbound   | primalbound  |  gap   | compl. 
t 0.0s|     1 |     0 |     0 |     - | trivial|   0 |   3 |   2 |   0 |   0 |  0 |   0 |   0 | 1.630000e+02 | 3.400000e+01 | 379.41%| unknown
t 0.0s|     1 |     0 |     0 |     - | trivial|   0 |   3 |   2 |   0 |   0 |  0 |   0 |   0 | 1.630000e+02 | 5.300000e+01 | 207.55%| unknown
p 0.0s|     1 |     0 |     0 |     - |   locks|   0 |   3 |   2 |   2 |   0 |  0 |   0 |   0 | 1.630000e+02 | 1.225000e+02 |  33.06%| unknown
  0.0s|     1 |     0 |     2 |     - |   583k |   0 |   3 |   2 |   2 |   0 |  0 |   0 |   0 | 1.252083e+02 | 1.225000e+02 |   2.21%| unknown
  0.0s|     1 |     0 |     2 |     - |   583k |   0 |   3 |   2 |   2 |   0 |  0 |   0 |   0 | 1.252083e+02 | 1.225000e+02 |   2.21%| unknown
  0.0s|     1 |     0 |     3 |     - |   585k |   0 |   3 |   2 |   3 |   1 |  1 |   0 |   0 | 1.225000e+02 | 1.225000e+02 |   0.00%| unknown
  0.0s|     1 |     0 |     3 |     - |   585k |   0 |   3 |   2 |   3 |   1 |  1 |   0 |   0 | 1.225000e+02 | 1.225000e+02 |   0.00%| unknown

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 0.00
Solving Nodes      : 1
Primal Bound       : +1.22500000000000e+02 (3 solutions)
Dual Bound         : +1.22500000000000e+02
Gap                : 0.00 %

在这里插入图片描述

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值