Discussion:
[SciPy-Dev] Interested in contributing BILP solver and interior-point method for linprog; SciPy-dev search down?
Matt Haberland
2017-02-05 05:13:21 UTC
Permalink
Hi all, I'm new to the list.

1. I am interested in contributing a binary integer linear programming
solver now, and possibly a more general MILP solver in the future. Existing
solutions (lp_solve, cvxopt, PuLp w/ GLPK) are not as easy to use as they
should be, at least for Windows users.

As I was writing the BILP code, I found a bug in linprog in which it would
report success, yet the bounds were not at all respected by the returned
solution.

I will report that bug, but in the meantime I started writing an
interior-point linear programming solver, which I'd be interested in
contributing as well.

Please let me know if you'd be interested in me contributing:
* A binary integer linear programming solver similar to Matlab's old
bintprog, but with options for both Balas' method and bintprog's branch and
bound algorithm
* A primal-dual interior-point method for linprog

2. I was trying to search the archives to see if there is already
discussion about integer programming or additional methods for linprog, but
it seems that the server:
http://dir.gmane.org/
isn't working?

I checked:
http://www.isitdownrightnow.com/dir.gmane.org.html
and it's down for everyone.

I just thought I should report that.

Thanks!
Matt
--
Matt Haberland
Assistant Adjunct Professor in the Program in Computing
Department of Mathematics
7620E Math Sciences Building, UCLA
Joshua Wilson
2017-02-05 17:56:32 UTC
Permalink
Post by Matt Haberland
As I was writing the BILP code, I found a bug in linprog in which it would
report success, yet the bounds were not at all respected by the returned
solution.
I wonder if it's the same as either of these?

https://github.com/scipy/scipy/issues/5400
https://github.com/scipy/scipy/issues/6690
Matt Haberland
2017-02-05 19:11:15 UTC
Permalink
Thanks. I thought it might be related, too, so I just posted my example in
issue 6690.
https://github.com/scipy/scipy/issues/6690

In any case, please let me know what you think about the addition of a
bintprog-like function and interior-point method for linprog.

Matt
Post by Joshua Wilson
Post by Matt Haberland
As I was writing the BILP code, I found a bug in linprog in which it
would
Post by Matt Haberland
report success, yet the bounds were not at all respected by the returned
solution.
I wonder if it's the same as either of these?
https://github.com/scipy/scipy/issues/5400
https://github.com/scipy/scipy/issues/6690
_______________________________________________
SciPy-Dev mailing list
https://mail.scipy.org/mailman/listinfo/scipy-dev
--
Matt Haberland
Assistant Adjunct Professor in the Program in Computing
Department of Mathematics
7620E Math Sciences Building, UCLA
Pierre Haessig
2017-02-07 08:37:30 UTC
Permalink
Hi,
Post by Matt Haberland
1. I am interested in contributing a binary integer linear programming
solver now, and possibly a more general MILP solver in the future.
Existing solutions (lp_solve, cvxopt, PuLp w/ GLPK) are not as easy to
use as they should be, at least for Windows users.
A MILP routine would be a great companion to the existing LP. As you
said, there are many existing solvers but the installation is not always
easy.

For cvxopt on Windows I found that the binary wheel from Christoph
Gohlke http://www.lfd.uci.edu/~gohlke/pythonlibs/#cvxopt did work with
Anaconda (last time I checked, a year a ago or so), but it's quite a
miracle to me.

best,
Pierre
Ralf Gommers
2017-02-14 09:15:10 UTC
Permalink
Post by Matt Haberland
Hi all, I'm new to the list.
1. I am interested in contributing a binary integer linear programming
solver now, and possibly a more general MILP solver in the future. Existing
solutions (lp_solve, cvxopt, PuLp w/ GLPK) are not as easy to use as they
should be, at least for Windows users.
As I was writing the BILP code, I found a bug in linprog in which it would
report success, yet the bounds were not at all respected by the returned
solution.
I will report that bug, but in the meantime I started writing an
interior-point linear programming solver, which I'd be interested in
contributing as well.
* A binary integer linear programming solver similar to Matlab's old
bintprog, but with options for both Balas' method and bintprog's branch and
bound algorithm
* A primal-dual interior-point method for linprog
I'm not a user of these optimization methods, so not sure. What would be
helpful is if someone can make a proposal of what the scope of linear
programming methods in SciPy should be, rather than adding them one by one.

There's an argument to be made for having a consistent set of well-known
algorithms in SciPy, but knowing the boundary of the scope here is helpful
especially if there are more powerful solutions like cvxopt that could
become easy to install soon. https://github.com/conda-forge/cvxopt-feedstock
exists, and once the OpenBLAS Windows issue is solved (I would bet on that
happening within a year) there'll be win64 binaries.
Post by Matt Haberland
2. I was trying to search the archives to see if there is already
discussion about integer programming or additional methods for linprog, but
http://dir.gmane.org/
isn't working?
Yes, Gmane suffered from lack of maintenance and is still recovering (it's
like that for months already). Our mailman archives are fine (
https://mail.scipy.org/pipermail/scipy-dev/) but aren't searchable. We're
still hoping for Gmane to recover - no one is actively working on migrating
AFAIK.

Ralf
Matt Haberland
2017-02-22 06:52:15 UTC
Permalink
Post by Ralf Gommers
I'm not a user of these optimization methods, so not sure. What would be
helpful is if someone can make a proposal of what the scope of linear
programming methods in SciPy should be, rather than adding them one by one.
There's an argument to be made for having a consistent set of well-known
algorithms in SciPy, but knowing the boundary of the scope here is
helpful especially if there are more powerful solutions like cvxopt that
could become easy to install soon. https://github.com/conda-
forge/cvxopt-feedstock exists, and once the OpenBLAS Windows issue is
solved (I would bet on that happening within a year) there'll be win64
binaries.
I'm not an expert in the scope of LP methods; I've only picked up some
information as I've been implementing this interior point method. But since
there haven't been any replies to your question, I'll attempt to answer,
and hopefully others will correct me. I'll take two approaches: first
identify the algorithms most popular in the literature, then look at the
algorithms used in the most popular software.

*In the literature...*

There seem to be two main branches of LP methods: basis exchange algorithms
(like the simplex method currently used in scipy.optimize.linprog) and
interior point methods (like the primal-dual path following code I want to
contribute).

A moderately deep search into the basis exchange algorithms brings up only
two names: simplex and criss-cross, each with a number of variations. The
simplex method is the easier of the two to visualize: it starts at a vertex
of the polytope defined by the problem constraints, traverses an edge in a
direction that decreases the objective function, and continues until there
are no such edges. Because it has to start at a vertex (and only visits
vertices), the simplex method often requires the solution of a "phase 1"
problem (often as time-consuming as the LP itself) to find a vertex. The
criss-cross method, on the other hand, is not restricted to feasible bases,
so it does not need to solve a "phase 1" problem and gets straight to work
on the LP itself. Unfortunately, this does not guarantee better
performance, as most criss-cross algorithms cannot guarantee that the
objective function is non-decreasing. Both have exponential complexity in
the worst case but fare much better in practice. There does not seem to be
consensus in the literature on whether one typically outperforms the other.

The poor worst-case complexity of basis-exchange algorithms spurred a lot
of work on (provably polynomial-complexity) interior point methods. The
ellipsoidal algorithm, Karmarkar's projective algorithm, and affine scaling
method are a few names of historical importance, but I've seen several
sources (not just Wikipedia...) state that primal-dual path-following
algorithms are the preferred choice today. In a sense, the approach turns
the linear programming problem with equality and inequality constraints
into a nonlinear programming problem with equality constraints (only). The
objective function is augmented with a "logarithmic barrier" that ensures
plenty of slack in the inequality constraints, and the (mildly nonlinear)
KKT conditions for this problem are iteratively solved as the logarithmic
barrier is gradually removed. I like to visualize it as if there is a force
pushing the current iterate point toward the center of the polytope while
another pulls it in the direction of decreasing objective, but I imagine
this is even more simplified/bastardized than my description of the simplex
method above.

Between basis-exchange and interior point branches, I haven't seen any
claims that one is generally superior in practice. While the worst-case
polynomial complexity of interior point methods is obviously better than
the worst-case exponential complexity of simplex, both tend to scale
approximately linearly with problem size for practical problems. Which of
the two performs better depends on the particulars of the problem.

*In software...*

Sandia published a "Comparison of Open-Source Linear Programming Solvers
<http://prod.sandia.gov/techlib/access-control.cgi/2013/138847.pdf>".
Hans Mittelman does benchmarks of optimization software
<http://plato.asu.edu/bench.html>.

Here are the names of the algorithms used in each. Basically there are just
three - primal simplex, dual simplex (which can be viewed as the primal
simplex method applied to the dual problem), and primal-dual path following.
CVXOPT <http://www.seas.ucla.edu/~vandenbe/publications/coneprog.pdf>:
primal-dual path following
QSOPT <http://www.math.uwaterloo.ca/~bico/qsopt/downloads/users.pdf>:
primal simplex, dual simplex
COIN-OR <https://www.coin-or.org/Clp/faq.html>: primal simplex, dual
simplex, primal-dual path following
<https://www.coin-or.org/Doxygen/Clp/classClpInterior.html>
GLPK <https://en.wikipedia.org/wiki/GNU_Linear_Programming_Kit> (see this
<http://www.maximalsoftware.com/solvers/glpk.html> also): primal simplex,
dual simplex, primal-dual path following
lp_solve <http://lpsolve.sourceforge.net/5.5/>: simplex
MINOS <http://www.sbsi-sol-optimize.com/asp/sol_products_minos_desc.htm>:
primal simplex
GUROBI <http://www.gurobi.com/products/features-benefits>: "Primal and dual
simplex algorithms, parallel barrier algorithm with crossover, concurrent
optimization, and sifting algorithm" (Parallel refers to the engagement of
multiple cores. Barrier probably refers to the logarithmic barrier function
used in the "primal-dual path following" above. Crossover seems to refer to
the generation of the optimal basis, as that is not automatically produced
by interior point methods. Concurrent optimization
<https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/parallel_optim/multi_threaded_parallel/11_concurrent.html>
seems to refer to running different algorithms simultaneously on separate
cores. Sifting is described here
<https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.cplex.help/CPLEX/UsrMan/topics/cont_optim/simplex/10_sifting.html>.
I don't think there are any fundamentally different algorithms here; just
extensions.)
CPLEX <https://en.wikipedia.org/wiki/CPLEX>: primal simplex, dual simplex,
barrier interior point (which, if they're going to be so vague, can be
considered synonymous with primal-dual path following)
XPRESS <http://www.solver.com/linear-quadratic-technology#Active Set Method>:
primal simplex, dual simplex, and primal-dual path following. (The
active-set method for SQP is also listed.)
MOSEK <https://en.wikipedia.org/wiki/MOSEK>: primal simplex, dual simplex,
and primal-dual path following
Matlab
<https://www.mathworks.com/help/optim/ug/linear-programming-algorithms.html>:
dual simplex (I suspect that it actually chooses between primal and dual
automatically), primal-dual path following (two variants)

*My conclusion:*
While there are lots of variants, there are only two major approaches:
simplex and primal-dual path following. While biased (as I've already
written the code and want to contribute it), I hope I've also shown that
compared to popular software, SciPy is somewhat incomplete without an
interior point method, and could be considered relatively complete with an
interior point method.
I don't know much about whether faster, free code will become more
accessible in Python. If this does happen, would linprog be removed from
SciPy? If not, I would suggest adding the interior point method now.

In my next email I'll compare the performance of my interior point code to
the current simplex implementation. In short, I've tried four types of
randomly generated problems and two non-random but scalable problems at
several scales, and the interior point code is faster for all of them. I'm
actually very surprised, but I have two explanations:
* interior point typically requires fewer iterations than simplex, which
means less overhead in calling compiled code (and more time spent *in*
compiled/optimized
code)
* the interior point code is written to leverage scipy.sparse matrices and
routines
If you have benchmark problems already written for linprog that you'd like
me to test (beyond those in the unit tests), please let me know.

Matt
--
Matt Haberland
Assistant Adjunct Professor in the Program in Computing
Department of Mathematics
7620E Math Sciences Building, UCLA
Gael Varoquaux
2017-02-22 07:07:45 UTC
Permalink
Post by Ralf Gommers
There's an argument to be made for having a consistent set of well-known
algorithms in SciPy, but knowing the boundary of the scope here is helpful
especially if there are more powerful solutions like cvxopt that could
become easy to install soon.
cvxopt is GPLv3 and scipy is BSD, so cvxopt cannot be a supplement of
scipy for everybody.

Gaël
Matt Haberland
2017-02-23 00:44:41 UTC
Permalink
Thanks for pointing out the more restrictive license of cvxopt, Gaël. Along
those lines:
lp_solve <http://lpsolve.sourceforge.net/5.5/LGPL.htm> is Lesser GPL.
GLPK <https://en.wikipedia.org/wiki/GNU_Linear_Programming_Kit> is GPLv3
(as one would expect)
COIN-OR <https://www.coin-or.org/Clp/faq.html> is CPL.
QSOPT <http://www.math.uwaterloo.ca/~bico/qsopt/ex/> is GPLv2.1+ or for
research use one (user's choice).
The rest of the codes are commercial, I believe.

As mentioned in my last email, I wanted to compare the performance of
linprog and the interior point code, which I'll refer to as linprog_ip. The
benchmark problems used were scalable and typically randomly-generated.
They were selected purely for their availability/ease of implementation
(except for the Klee-Minty Hypercube, which is the bane of simplex solvers.
It is possible that many of these tests are particularly challenging to
simplex solvers, but the only one I know to punish simplex is the
Klee-Minty hypercube.) I'd love to test with the more practical NETLIB
<http://www.cuter.rl.ac.uk/Problems/netlib.shtml> benchmarks but these are
in MPS format and I haven't looked into how to convert yet.

The results are available at:
https://www.dropbox.com/s/8vfye61kvn9h3zg/linprog_benchmarks.pdf?dl=0
and details about the tests are in the postscript.

In summary, linprog_ip is significantly faster for all but the smallest
problems (those that are solved in hundredths of a second), and is more
reliable at finding solutions when they exist.. As problem size increases,
the performance gap tends to increase. For sparse problems, the ability of
linprog_ip to leverage scipy.sparse linear algebra yields great
improvement. For certain types of problems, linprog has difficulty finding
a starting point, and takes longer to fail than linprog_ip does to return
the optimal solution.

Besides the test results, please also see all open linprog bug reports: 5400
<https://github.com/scipy/scipy/issues/5400>, 6139
<https://github.com/scipy/scipy/issues/6139>, 6690
<https://github.com/scipy/scipy/issues/6690>, 7044
<https://github.com/scipy/scipy/issues/7044>. linprog_ip suffers from none
of these. Of course, it also passes all the linprog unit tests and many
more I have written.

I attribute the success of linprog_ip to the algorithm it implements and
the suitability of the algorithm to NumPy/SciPy. For instance, for lpgen_2D
with 60 constraints and 60 variables, linprog reports about 140 iterations
whereas linprog_ip finishes in 9. Each of linprog's iterations has loops
that do one elementary row operations per loop iteration, whereas at the
heart of a linprog_ip iteration is the Cholesky factorization of a matrix
and back/forward substitution for four different right hand sides (all
LAPACK via scipy.linalg.solve). Consequently, linprog_ip spends larger
chunks of time in compiled code with far fewer loops/function calls in
Python.

Please let me know if you'd like to see the interior point code included in
SciPy, and I'll integrate with linprog and figure out the submission
process. (If you are familiar with compiling from source on Windows, please
shoot me an email. After pushing through a few roadblocks, I'm stuck with a
very vague error message.)

Matt


-----


All tests were performed on a Dell XPS 13, IntelCore i5-4200 CPU at 1.6-2.3
GHz, 8GB RAM, and Windows 10 64-bit. Tests were timed using line_profiler (
kernprof). For randomized problems, each of N problems of arbitrary size (m
constraints, n variables) were generated and solved by linprog and
linprog_ip in either (random) order. For non-random problems, the same
problem of a given dimension was solved by linprog and linprog_ip in either
(random) order N times. Unless otherwise noted, the consistency of the
solutions returned by linprog and linprog_ip was checked by comparing the
objective function value using numpy.allclose with default tolerances.
Times reported are the average per hit (call to linprog or linprog_ip ) in
units of 4.46E-07 s and also as normalized by the faster of the two times
(1 is better; the other number indicates how many times longer it took).

1. lpgen_2D <https://gist.github.com/denis-bz/8647461>, the randomized test
case currently part of the linprog unit tests.
*Note that in these tests there are actually m*n variables and m+n
constraints. For example, in the last test there are 800 constraints and
160000 variables.*
(Unfortunately, I realized after testing that I left np.random.seed(0) in
the code, and thus the same problem was solved N times per test. However,
unreported testing after fixing this yielded similar results.)

2. zionts1
<http://onlinelibrary.wiley.com/doi/10.1111/1475-3995.00392/abstract>, a
randomized test with inequality constraints originally used by Zionts to
compare the performance of his criss-cross algorithm to the simplex.
Occasionally, linprog fails to find a feasible initial point, even where a
solution exist, as reported in Issue 6139
<https://github.com/scipy/scipy/issues/6139>.

3. zionts2
<http://onlinelibrary.wiley.com/doi/10.1111/1475-3995.00392/abstract>, a
randomized test with both equality and inequality constraints originally
used by Zionts to compare the performance of his criss-cross algorithm to
the simplex. For problems of moderate size, linprog fails to find a
feasible initial point, even where a solution exist, as reported in Issue
6139 <https://github.com/scipy/scipy/issues/6139>.

4. bonates
<http://onlinelibrary.wiley.com/doi/10.1111/1475-3995.00392/abstract>, a
sparse, randomized test used in "Performance evaluation of a family of
criss–cross algorithms for linear programming". Here, percentage of
nonzeros (density) is reported as p (the sparsity is 1-p). The solutions
are typically infeasible or unbounded; the time reported is that required
for the solver to reach this conclusion. linprog always terminates when it
fails to find a feasible initial point. linprog_ip reports whether the
problem is infeasible or unbounded.

5. magic_square, an LP-relaxed version of a binary integer linear program
designed to find a magic square <https://en.wikipedia.org/wiki/Magic_square>
of size D. The cost vector is random; any feasible solution represents a
magic square. The problem includes equality constraints and simple bounds
(0, 1). As formulated, the problem's equality constraint matrix is rank
deficient (in a non-obvious way), causing linprog to report success despite
the fact that the returned solution is infeasible and the objective value
is inconsistent with the solution, as reported in Issue 6690
<https://github.com/scipy/scipy/issues/6690>. To enable performance
comparison, I've lent linprog the use of linprog_ip's presolve routine,
which removes redundant rows such that linprog is able to solve the problem
correctly.

6. klee_minty <https://en.wikipedia.org/wiki/Klee%E2%80%93Minty_cube>, a
problem that elicits the worst-case performance of Dantzig's original
simplex method. Here, Bland's rule is used by linprog. (Its runtime is far
worse with the default pivoting rule.)

On Tue, Feb 21, 2017 at 11:07 PM, Gael Varoquaux <
Post by Ralf Gommers
Post by Ralf Gommers
There's an argument to be made for having a consistent set of
well-known
Post by Ralf Gommers
algorithms in SciPy, but knowing the boundary of the scope here is
helpful
Post by Ralf Gommers
especially if there are more powerful solutions like cvxopt that
could
Post by Ralf Gommers
become easy to install soon.
cvxopt is GPLv3 and scipy is BSD, so cvxopt cannot be a supplement of
scipy for everybody.
Gaël
_______________________________________________
SciPy-Dev mailing list
https://mail.scipy.org/mailman/listinfo/scipy-dev
--
Matt Haberland
Assistant Adjunct Professor in the Program in Computing
Department of Mathematics
7620E Math Sciences Building, UCLA
Gael Varoquaux
2017-02-23 06:46:15 UTC
Permalink
Post by Matt Haberland
Please let me know if you'd like to see the interior point code included in
SciPy,
I personnaly think that it would be a good thing, given that it is a
fairly general and core set of problems. But I am not very active in
scipy anymore, so it's more a comment from the peanut gallery than an
educated opinion.

Cheers,

Gaël
Pierre Haessig
2017-02-23 14:49:23 UTC
Permalink
Hi,
Post by Matt Haberland
Please let me know if you'd like to see the interior point code
included in SciPy, and I'll integrate with linprog and figure out the
submission process. (If you are familiar with compiling from source on
Windows, please shoot me an email. After pushing through a few
roadblocks, I'm stuck with a very vague error message.)
I haven't looked at your detailed results, only your email. Still, the
fact you checked both the speed and the accuracy looks very convincing
to me (I've been bitten by the lack of accuracy of Scipy linprog in the
past).

In terms of API, my only suggestion would be to keep one single linprog
routine, with a switch (between IP and simplex). Given your
demonstration of the superiority of your algo, it should be the default.

best,
Pierre
Matt Haberland
2017-02-28 23:01:56 UTC
Permalink
Based on positive feedback, I've gone ahead and completed most of the
finishing touches: documentation, pep8 compliance, etc... for the
"interior-point" method of linprog.

As this is my first contribution to SciPy, I would appreciate a real-time
conversation with somebody regarding some remaining questions. Would an
experienced contributor, like whomever might review the forthcoming pull
request, be willing to schedule a time to chat?

Thanks!
Matt

--------

P.S. Example questions:

- How strict does PEP8 compliance need to be? For instance, do I really
need to replace lambda functions (defined within functions) with regular
functions? (There are a few other things autopep8 couldn't fix I want to
ask about.)
- The code currently spits out warnings using the standard warnings module.
Is that OK or is there some other standard for SciPy? Does there need to to
be an option to disable these, or can we let the user suppress them
otherwise if desired?
- I have a several non-essential feature questions like "Do I need to
implement a callback interface like the simplex method does, or can that be
left for an update?" Some of these are technical but each can be explained
with about one sentence of background information. I'm just looking for
opinions from anyone willing to think about it for 10 seconds.

P.P.S. Re: Pierre's comment: regarding lack of accuracy, you mean when
linprog fails to find a solution when it exists or reports that it has
found a solution when it hasn't? Agreed, I think the interior point method
would help fix that. And its presolve subroutine could help the simplex
code avoid some of those problems.

However because the simplex method traverses vertices to numerical
precision, its solutions (when it finds them) will typically be more
"exact", whereas interior point methods terminate when a user specified
tolerance is met. Along those lines, interior point methods can return
solutions at the boundary of the polytope but not at a vertex, and so they
do not always identify an optimal basis, which some applications require.
There are "crossover" methods to do this from an interior point solution
but I haven't looked into those yet.

For that reason, and to allow time for any bugs with the IP code to
surface, should "simplex" remain the default, if the linprog documentation
were to state that "interior-point" could be faster?
Post by Pierre Haessig
Hi,
Post by Matt Haberland
Please let me know if you'd like to see the interior point code
included in SciPy, and I'll integrate with linprog and figure out the
submission process. (If you are familiar with compiling from source on
Windows, please shoot me an email. After pushing through a few
roadblocks, I'm stuck with a very vague error message.)
I haven't looked at your detailed results, only your email. Still, the
fact you checked both the speed and the accuracy looks very convincing
to me (I've been bitten by the lack of accuracy of Scipy linprog in the
past).
In terms of API, my only suggestion would be to keep one single linprog
routine, with a switch (between IP and simplex). Given your
demonstration of the superiority of your algo, it should be the default.
best,
Pierre
_______________________________________________
SciPy-Dev mailing list
https://mail.scipy.org/mailman/listinfo/scipy-dev
--
Matt Haberland
Assistant Adjunct Professor in the Program in Computing
Department of Mathematics
7620E Math Sciences Building, UCLA
Evgeni Burovski
2017-03-01 14:20:05 UTC
Permalink
Post by Matt Haberland
Based on positive feedback, I've gone ahead and completed most of the
finishing touches: documentation, pep8 compliance, etc... for the
"interior-point" method of linprog.
As this is my first contribution to SciPy, I would appreciate a real-time
conversation with somebody regarding some remaining questions. Would an
experienced contributor, like whomever might review the forthcoming pull
request, be willing to schedule a time to chat?
Thanks!
Matt
--------
How strict does PEP8 compliance need to be? For instance, do I really need
to replace lambda functions (defined within functions) with regular
functions? (There are a few other things autopep8 couldn't fix I want to ask
about.)
The code currently spits out warnings using the standard warnings module. Is
that OK or is there some other standard for SciPy? Does there need to to be
an option to disable these, or can we let the user suppress them otherwise
if desired?
I have a several non-essential feature questions like "Do I need to
implement a callback interface like the simplex method does, or can that be
left for an update?" Some of these are technical but each can be explained
with about one sentence of background information. I'm just looking for
opinions from anyone willing to think about it for 10 seconds.
P.P.S. Re: Pierre's comment: regarding lack of accuracy, you mean when
linprog fails to find a solution when it exists or reports that it has found
a solution when it hasn't? Agreed, I think the interior point method would
help fix that. And its presolve subroutine could help the simplex code avoid
some of those problems.
However because the simplex method traverses vertices to numerical
precision, its solutions (when it finds them) will typically be more
"exact", whereas interior point methods terminate when a user specified
tolerance is met. Along those lines, interior point methods can return
solutions at the boundary of the polytope but not at a vertex, and so they
do not always identify an optimal basis, which some applications require.
There are "crossover" methods to do this from an interior point solution but
I haven't looked into those yet.
For that reason, and to allow time for any bugs with the IP code to surface,
should "simplex" remain the default, if the linprog documentation were to
state that "interior-point" could be faster?
Hi Matt,

Our development process is quite asynchronous at this time, so please
don't be discouraged if you don't get much responses about a real-time
conversation. It's just that we are spread quite thin all across the
globe.

Since your code is at the polishing stage already, a way forward can
be to send a work-in-progress pull request on GitHub already. This
will both give you feedback about style things like pep8 (we have a
specialized checker which runs automatically on new PRs), and will
hopefully help to attract reviewers. The PR does not need to be
perfect from the start, most PRs go over a series of iterations
anyway.

Cheers,

Evgeni
Ralf Gommers
2017-03-02 11:54:08 UTC
Permalink
Post by Matt Haberland
Post by Matt Haberland
Based on positive feedback, I've gone ahead and completed most of the
finishing touches: documentation, pep8 compliance, etc... for the
"interior-point" method of linprog.
As this is my first contribution to SciPy, I would appreciate a real-time
conversation with somebody regarding some remaining questions. Would an
experienced contributor, like whomever might review the forthcoming pull
request, be willing to schedule a time to chat?
Thanks!
Matt
--------
How strict does PEP8 compliance need to be? For instance, do I really
need
Post by Matt Haberland
to replace lambda functions (defined within functions) with regular
functions? (There are a few other things autopep8 couldn't fix I want to
ask
Post by Matt Haberland
about.)
The code currently spits out warnings using the standard warnings
module. Is
Post by Matt Haberland
that OK or is there some other standard for SciPy? Does there need to to
be
Post by Matt Haberland
an option to disable these, or can we let the user suppress them
otherwise
Post by Matt Haberland
if desired?
I have a several non-essential feature questions like "Do I need to
implement a callback interface like the simplex method does, or can that
be
Post by Matt Haberland
left for an update?" Some of these are technical but each can be
explained
Post by Matt Haberland
with about one sentence of background information. I'm just looking for
opinions from anyone willing to think about it for 10 seconds.
P.P.S. Re: Pierre's comment: regarding lack of accuracy, you mean when
linprog fails to find a solution when it exists or reports that it has
found
Post by Matt Haberland
a solution when it hasn't? Agreed, I think the interior point method
would
Post by Matt Haberland
help fix that. And its presolve subroutine could help the simplex code
avoid
Post by Matt Haberland
some of those problems.
However because the simplex method traverses vertices to numerical
precision, its solutions (when it finds them) will typically be more
"exact", whereas interior point methods terminate when a user specified
tolerance is met. Along those lines, interior point methods can return
solutions at the boundary of the polytope but not at a vertex, and so
they
Post by Matt Haberland
do not always identify an optimal basis, which some applications require.
There are "crossover" methods to do this from an interior point solution
but
Post by Matt Haberland
I haven't looked into those yet.
For that reason, and to allow time for any bugs with the IP code to
surface,
Post by Matt Haberland
should "simplex" remain the default, if the linprog documentation were to
state that "interior-point" could be faster?
Hi Matt,
Our development process is quite asynchronous at this time, so please
don't be discouraged if you don't get much responses about a real-time
conversation. It's just that we are spread quite thin all across the
globe.
Since your code is at the polishing stage already, a way forward can
be to send a work-in-progress pull request on GitHub already.
+1 for submitting what you have already (start the PR title with WIP: ),
always good to get people to comment on it.

I'm happy to have a quick chat though if you prefer that. I'm 21 hours
ahead of you; my 8-9am (your 11-12am) works well if you ping me in advance.

Ralf

Loading...