sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.38k stars 469 forks source link

Add package pyscipopt, add MIP backend #21003

Closed mkoeppe closed 1 year ago

mkoeppe commented 8 years ago

This ticket adds a package pyscipopt and adds a new MIP backend based on it.

https://github.com/scipopt/PySCIPOpt

Branch is on top of #31329.

Steps to get it to work:

Depends on #31329

CC: @mo271 @yuan-zhou @malb @dcoudert @dimpase

Component: linear programming

Keywords: days84, IMA-PolyGeom

Author: Matthias Koeppe, Moritz Firsching, Martin Rubey

Branch/Commit: 099c15b

Reviewer: Moritz Firsching, Vincent Delecroix, David Coudert, Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/21003

mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -1 +1,4 @@
 http://scip.zib.de/doc/html/PYTHON_INTERFACE.php
+
+https://github.com/SCIP-Interfaces/PySCIPOpt
+
mkoeppe commented 8 years ago

Changed dependencies from #10879 to #21094

mkoeppe commented 8 years ago

Branch: u/mkoeppe/pyscipopt

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Commit: db1b1d9

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

7075b83Pacth SCIP Makefile more to get library dependencies right
b372675Fixup
49659e3Fixup
db1b1d9Merge branch 't/21094/sage_package_for_scip_integer_programming_solver' into t/21003/pyscipopt
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

805a034Merge tag '7.4.beta0' into t/21003/pyscipopt
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 8 years ago

Changed commit from db1b1d9 to 805a034

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

a3bf199Add SCIP backend (stubs only)
d3271c0New pip package pyscipopt
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from 805a034 to d3271c0

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from d3271c0 to 41b70bb

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

41b70bbPySCIPOpt: Install from git
mkoeppe commented 7 years ago

Description changed:

--- 
+++ 
@@ -1,3 +1,6 @@
+This ticket adds a package pyscipopt and prepares a new MIP backend based on it.
+Currently all methods are just stubs. They need to be filled in.
+
 http://scip.zib.de/doc/html/PYTHON_INTERFACE.php

 https://github.com/SCIP-Interfaces/PySCIPOpt
videlec commented 7 years ago

Changed keywords from none to days84

mkoeppe commented 7 years ago

Author: Matthias Koeppe, needs more authors

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from 41b70bb to d973980

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

6cc2bd7Update patches and script for 4.0.0
31f7397Merge branch 't/22557/upgrade_scipopt_to_4_0' into t/21003/pyscipopt
92b7420pyscipopt: Use real upstream git
d973980SCIPBackend: First step
mkoeppe commented 7 years ago

Description changed:

--- 
+++ 
@@ -5,3 +5,4 @@

 https://github.com/SCIP-Interfaces/PySCIPOpt

+Branch is on top of #22557.
mkoeppe commented 7 years ago

Changed dependencies from #21094 to #22557

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from d973980 to 9794b3a

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

ccf5e37Update patches and script for 4.0.0
75fb34cUse OPT=opt on Linux. Check results of test suite
74f1d79scip: Working configuration for clang on Mac
0f37658scipoptsuite: Use clang on Mac OS
607a51cAdd SCIP backend (stubs only)
05a723fNew pip package pyscipopt
74a2875PySCIPOpt: Install from git
b433c65pyscipopt: Use real upstream git
9794b3aSCIPBackend: First step
mo271 commented 6 years ago

Changed dependencies from #22557 to #22557, #24662

mo271 commented 6 years ago

Changed branch from u/mkoeppe/pyscipopt to u/moritz/pyscipopt

mo271 commented 6 years ago

Changed commit from 9794b3a to f260221

mo271 commented 6 years ago
comment:18

This (hopefully) works now, after putting PySCIPOpt-1.4.0.tar.gz into upstream, which can be found here:

https://pypi.python.org/packages/59/73/087bcb1d4e284681346a8847b83c5a86568dd19034ead0884450fa6bda50/PySCIPOpt-1.4.0.tar.gz#md5=6d40750e286348247e31e568bf16ee2d

UPDATE (from a later edit): now you need to put PySCIPOpt-1.4.2.tar.gz https://pypi.python.org/packages/c0/b6/b619a33cd90dbf5579de341c873f85f0388030c47ee5da71a9113ee308d4/PySCIPOpt-1.4.2.tar.gz#md5=4f175316bc3ba4ce97c284434a4b62f0

UPDATE (from yet a later edit): Check the description of the ticket for the latest version!


Last 10 new commits:

966aeb9compiling with cmake
057a2c7add dependency info
f4a061euse cmake sage package; make output verbose
b86cf01scipoptsuite: Add patch for using libhistory (needed for Mac OS X)
e94b94eimproving the check
6cce2c7Add SCIP backend (stubs only)
4eb6e95New pip package pyscipopt
fbe8e62PySCIPOpt: Install from git
9c8d7c6pyscipopt: Use real upstream git
f260221SCIPBackend: First step
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from f260221 to 8fdae7c

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

8fdae7cnew version 1.4.0
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from 8fdae7c to 1958470

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

1958470added SPKG.txt
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from 1958470 to 6ebdc93

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

b0462bdstarting with the backend
6ebdc93most functions of the backend
mo271 commented 6 years ago

Changed author from Matthias Koeppe, needs more authors to Matthias Koeppe, Moritz Firsching, needs more authors

mkoeppe commented 6 years ago

Changed keywords from days84 to days84, IMA-PolyGeom

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

1eb3412almost all doctests working, some pyscipopt patches
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from 6ebdc93 to 1eb3412

mo271 commented 6 years ago

Description changed:

--- 
+++ 
@@ -1,8 +1,12 @@
-This ticket adds a package pyscipopt and prepares a new MIP backend based on it.
-Currently all methods are just stubs. They need to be filled in.
-
-http://scip.zib.de/doc/html/PYTHON_INTERFACE.php
+This ticket adds a package pyscipopt and adds a new MIP backend based on it.

 https://github.com/SCIP-Interfaces/PySCIPOpt

-Branch is on top of #22557.
+Branch is on top of #24662. 
+
+Steps to get it to work:
+- pull from this branch
+- put http://scip.zib.de/download.php?fname=scipoptsuite-5.0.1.tgz in `./upstream` (see #24662)
+- put [PySCIPOpt-1.4.2.tar.gz](https://pypi.python.org/packages/c0/b6/b619a33cd90dbf5579de341c873f85f0388030c47ee5da71a9113ee308d4/PySCIPOpt-1.4.2.tar.gz#md5=4f175316bc3ba4ce97c284434a4b62f0,)  in `./upstream`
+- `sage -f pyscipopt`
+
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from 1eb3412 to a586569

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

84e6b11getParam and setParam working
67542beall methods implemented in backend; all doctests working
a586569one more patch
mo271 commented 6 years ago
comment:27

In this version, there are a number of patches in the patches directory. All of them will be merged upstream in a version of pyscipopt with version number >=1.4.3, which should be available on Pypi not too long from now. I will update the pyscipopt package then.

mo271 commented 6 years ago

Changed author from Matthias Koeppe, Moritz Firsching, needs more authors to Matthias Koeppe, Moritz Firsching

mkoeppe commented 6 years ago

Changed branch from u/moritz/pyscipopt to u/mkoeppe/pyscipopt

mkoeppe commented 6 years ago

Changed commit from a586569 to 080bc90

mkoeppe commented 6 years ago
comment:30

I merged latest #24662.

All doctests need to be marked # optional - pyscipopt


New commits:

f4ad108put readline as depency
8b20290scipoptsuite: Update patch to remove cmake warning
f25f900scipoptsuite: Set GMP_DIR so that we do not catch /usr/local/include
d49ff94scipoptsuite: Add patch: ZIMPL cmake scripts: Put ZIMPL includes first to avoid clash of idxset.h with install soplex idxset.h
d7e29d5scipoptsuite: Fix install name for libscip on Mac
737e606Make bliss and MP_LIBRARY dependencies, cmake order-only dependency
080bc90Merge branch 't/24662/public/scipoptsuite' into t/21003/pyscipopt
mkoeppe commented 6 years ago
comment:31

Also 1.4.3 is out.

mo271 commented 6 years ago
comment:32

in the meantime its version 1.4.4: I am on it...

mo271 commented 6 years ago

Changed branch from u/mkoeppe/pyscipopt to u/moritz/pyscipopt

mo271 commented 6 years ago
comment:34

I marked all doctest optional and updated.

Suddenly, one doctest doesn't work anymore:

sage: g = graphs.CubeGraph(9)
sage: p = MixedIntegerLinearProgram(solver = "SCIP")                # optional - pyscipopt

sage: b = p.new_variable(binary=True)                               # optional - pyscipopt
sage: p.set_objective(p.sum(b[v] for v in g))                       # optional - pyscipopt
sage: for v in g:                                                   # optional - pyscipopt
....:     p.add_constraint(b[v]+p.sum(b[u] for u in g.neighbors(v)) <= 1) # optional - pyscipopt
sage: p.add_constraint(b[v] == 1) # Force an easy non-0 solution    # optional - pyscipopt
sage: p.solver_parameter("limits/absgap", 100)                      # optional - pyscipopt
sage: p.solve() # rel tol 100                                       # optional - pyscipopt

and totaly chrashes sage with an error message free(): invalid pointer. I don't quite know what is going on.

What is really weird is that it works if I don't run the last line, but instead:

sage: q = copy(p)
sage: q.solver_parameter("limits/absgap", 100)
sage: q.solve()
0

(I temperarily change 9 to 4 in the doctest above, in order to be able to run the rest of the doctest. The current branch works without failures for me.)


Last 10 new commits:

0544b25almost all doctests working, some pyscipopt patches
c774d7egetParam and setParam working
41f641ball methods implemented in backend; all doctests working
c10594cone more patch
c7eee88pyscipopt: update to v1.4.3
a054b24pyscipopt: update to v1.4.4
3e5621ascip-backend: added '# optional - pyscipopt'
52b98d0Make bliss and MP_LIBRARY dependencies, cmake order-only dependency
f217970quicksum and modify doctests
82fd6d6remove all patches
mo271 commented 6 years ago

Changed commit from 080bc90 to 82fd6d6

mo271 commented 6 years ago
comment:35

... the nice thing: all my patches have been merged by a very responsive upstream!

mo271 commented 6 years ago

Description changed:

--- 
+++ 
@@ -7,6 +7,6 @@
 Steps to get it to work:
 - pull from this branch
 - put http://scip.zib.de/download.php?fname=scipoptsuite-5.0.1.tgz in `./upstream` (see #24662)
-- put [PySCIPOpt-1.4.2.tar.gz](https://pypi.python.org/packages/c0/b6/b619a33cd90dbf5579de341c873f85f0388030c47ee5da71a9113ee308d4/PySCIPOpt-1.4.2.tar.gz#md5=4f175316bc3ba4ce97c284434a4b62f0,)  in `./upstream`
+- put [PySCIPOpt-1.4.4.tar.gz](https://files.pythonhosted.org/packages/50/2e/392ae55d3c13ef7d91eee69c764d6362e1e27f7ecceee00572f60637522c/PySCIPOpt-1.4.4.tar.gz,)  in `./upstream`
 - `sage -f pyscipopt`
mo271 commented 6 years ago

Description changed:

--- 
+++ 
@@ -7,6 +7,6 @@
 Steps to get it to work:
 - pull from this branch
 - put http://scip.zib.de/download.php?fname=scipoptsuite-5.0.1.tgz in `./upstream` (see #24662)
-- put [PySCIPOpt-1.4.4.tar.gz](https://files.pythonhosted.org/packages/50/2e/392ae55d3c13ef7d91eee69c764d6362e1e27f7ecceee00572f60637522c/PySCIPOpt-1.4.4.tar.gz,)  in `./upstream`
+- put [PySCIPOpt-1.4.4.tar.gz](https://files.pythonhosted.org/packages/50/2e/392ae55d3c13ef7d91eee69c764d6362e1e27f7ecceee00572f60637522c/PySCIPOpt-1.4.4.tar.gz)  in `./upstream`
 - `sage -f pyscipopt`