LoginSignup
4

More than 5 years have passed since last update.

posted at

updated at

SCIPをMacにインストール

非商用で最も高速に混合整数(非)線形計画問題を解けると言われるSCIPのMacへのインストール方法です.
結論から言えば,特に問題なくソースからコンパイルできました.

私の理解ではSCIPは以下の点が良いです:

  • 非商用,無償の中では速い
  • いろいろ解ける
    • linear programming (LP), mixed integer programming (MIP), and mixed integer nonlinear programming (MINLP)
  • PythonやJavaから呼び出せる

執筆時点2014.12.07にて最新のVer. 3.1.0を前提に書いています.
また,SCIPの非商用ライセンスZIB Academic Licenseにて利用する場合の内容です.

ダウンロード

scipoptsuite-3.1.0.tgzSCIPからダウンロード

  • Downloadをクリック
  • Source code: SCIP Optimization Suiteをクリック
  • I certify that I will use the software only as a member of a noncommercial and academic institute and that I have read and accepted the ZIB Academic License.を選択
  • Start Downloadをクリック

コンパイル

tar fzxv scipoptsuite-3.1.0.tgz
cd scipoptsuite-3.1.0
make

テスト

** Build complete.
** Find your SCIP binary in "/Users/kato/dev/SCIP/scipoptsuite-3.1.0/scip-3.1.0/bin".
** Enter "make test" to solve a number of easy instances in order to verify that SCIP runs correctly.

と表示されるので

make test

を実行.

SCIPのインストール

cd scip-3.1.0
make install INSTALLDIR=/usr/local/

特に問題なくインストールが終わってしまった.
(Macでインストールする時に何か問題が起こることを期待していたのだけれど・・・).

Interactive Shell

以下を実行するとInteractive Shellを開ける:

scip

問題の読み込み

SCIP> read check/instances/MIP/stein27.fzn

read problem <check/instances/MIP/stein27.fzn>
============

original problem has 29 variables (29 bin, 0 int, 0 impl, 0 cont) and 118 constraints

問題の最適化

SCIP> optimize
...
SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 0.79
Solving Nodes      : 3838
Primal Bound       : +1.80000000000000e+01 (315 solutions)
Dual Bound         : +1.80000000000000e+01
Gap                : 0.00 %

解の出力

SCIP> display solution

objective value:                                   18
true                                                1   (obj:0)
x0001                                               1   (obj:1)
x0002                                               1   (obj:1)
x0005                                               1   (obj:1)
x0008                                               1   (obj:1)
x0009                                               1   (obj:1)
x0011                                               1   (obj:1)
x0012                                               1   (obj:1)
x0016                                               1   (obj:1)
x0017                                               1   (obj:1)
x0018                                               1   (obj:1)
x0019                                               1   (obj:1)
x0020                                               1   (obj:1)
x0022                                               1   (obj:1)
x0023                                               1   (obj:1)
x0024                                               1   (obj:1)
x0025                                               1   (obj:1)
x0026                                               1   (obj:1)
x0027                                               1   (obj:1)

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
4