Google constraint programming solver

116 views
Skip to first unread message

Michele Comignano

unread,
Sep 24, 2010, 7:09:19 PM9/24/10
to sage-...@googlegroups.com
Hi to all,
on September, the 15th Google made public the source code of its
operations research internal tools. That consist essetially of a
costraint programming solver and some graph-related algorithms. The cp
solver has also a nice Python interface making it perfect for Sage
integration.
Sage is lacking a cp solver and that could be a viable possibility to
have one in it.

License is Apache 2.0 and here is the project home:
https://code.google.com/p/or-tools/.

What do you think about?

--
Michele Comignano
Computer Science student
University of Pisa, Italy

Tom Boothby

unread,
Sep 24, 2010, 9:59:09 PM9/24/10
to sage-...@googlegroups.com
I kinda like the look of it, though I'm unfamiliar with constraint
programming. It looks like it solves TSP, so that seems like a good
enough reason for me. However, there are some standard questions
before we add something to Sage:

Is it stable? Robust? Is the documentation useful / readable? What
benefit would there be to including it in Sage -- couldn't a
marginally interested user just install this locally? And here's the
big one: are you (or do you know somebody) willing to commit to
maintaining the package for the lifetime of its inclusion into Sage?

> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

Dima Pasechnik

unread,
Sep 24, 2010, 11:41:00 PM9/24/10
to sage-devel
It's worth including, IMHO
(at least one could solve Sudoku in Sage then:
https://sites.google.com/site/ortoolssite/home/using-the-constraint-programming-solver/anatomy-of-a-python-constraint-programming-example
:-))

It's also good to have graph algorithm implementations s that are
"orthogonal" to Sage's, even if for the testing purposes.

Unfortunately, there isn't much in terms of documentation there.
As well, it is known not to run on MacOSX PPC, which is one of Sage
official platforms.

An experimental package, most probably, then...

Dima

Tom Boothby

unread,
Sep 24, 2010, 11:56:52 PM9/24/10
to sage-...@googlegroups.com
On Fri, Sep 24, 2010 at 8:41 PM, Dima Pasechnik <dim...@gmail.com> wrote:
> It's worth including, IMHO
> (at least one could solve Sudoku in Sage then:
> https://sites.google.com/site/ortoolssite/home/using-the-constraint-programming-solver/anatomy-of-a-python-constraint-programming-example
> :-))

http://www.sagemath.org/doc/reference/sage/games/sudoku.html

Dima Pasechnik

unread,
Sep 25, 2010, 12:34:45 AM9/25/10
to sage-devel
welll, well, well, so you'd get a competitor then :-)
But of course C(S)P is much more than that --- sudoku is a nice toy
example, though.

On Sep 25, 11:56 am, Tom Boothby <tomas.boot...@gmail.com> wrote:
> On Fri, Sep 24, 2010 at 8:41 PM, Dima Pasechnik <dimp...@gmail.com> wrote:
> > It's worth including, IMHO
> > (at least one could solve Sudoku in Sage then:
> >https://sites.google.com/site/ortoolssite/home/using-the-constraint-p...

Tom Boothby

unread,
Sep 25, 2010, 12:47:47 AM9/25/10
to sage-...@googlegroups.com
> It's also good to have graph algorithm implementations s that are
> "orthogonal" to Sage's, even if for the testing purposes.

Agreed.

> Unfortunately, there isn't much in terms of documentation there.
> As well, it is known not to run on MacOSX PPC, which is one of Sage
> official platforms.

That won't do...

> An experimental package, most probably, then...

By all means, it could (and should!) be made into an experimental package.

Dima Pasechnik

unread,
Sep 25, 2010, 2:05:00 AM9/25/10
to sage-devel
I played a bit with the source, and it does not look like it is ready
for even sub-prime time...
E.g. there is no configure, and the K8 processor is hardwired (-
DARCH_K8) in the makefile.
As well, it does use "long long int" in C++, which is not standard...

Martin Albrecht

unread,
Sep 25, 2010, 1:57:40 PM9/25/10
to sage-...@googlegroups.com
Just a quick note:

I started writing a SCIP wrapper for Sage which is also a CIP solver. It is
only free for accademic use though:

http://scip.zib.de

Cheers,
Martin
--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://martinralbrecht.wordpress.com/
_jab: martinr...@jabber.ccc.de

YannLC

unread,
Sep 25, 2010, 2:44:20 PM9/25/10
to sage-devel
It might be worse to allow some output to the minizinc format:
http://www.g12.cs.mu.oz.au/minizinc/
Many good solvers have flatzinc interfaces: Gecode, ECLiPSe, SCIP, etc

On Sep 25, 7:57 pm, Martin Albrecht <martinralbre...@googlemail.com>
wrote:
> _jab: martinralbre...@jabber.ccc.de

Michele Comignano

unread,
Sep 25, 2010, 5:15:51 PM9/25/10
to sage-...@googlegroups.com
Il 25/09/2010 03:59, Tom Boothby ha scritto:
> I kinda like the look of it, though I'm unfamiliar with constraint
> programming. It looks like it solves TSP, so that seems like a good
> enough reason for me. However, there are some standard questions
> before we add something to Sage:
>
> Is it stable?
No, they released just few days ago, it has been internal code before
September 15th.
> Robust?
Can't say without long time testing. But it works.

> Is the documentation useful / readable?
Is possible to make better, but the porject has been open sourced little
time ago.

> What benefit would there be to including it in Sage -- couldn't a
> marginally interested user just install this locally?
Couldn't a marginally interested user just install the required sage component of sage locally?
The main advantage (can say the mission) of Sage is offering a unified and clear interface to good
open source mathematics software, all in one. Sage already has a good mip solver interface. I think having
more or-tools into sage being better than having less. And constaint programming is a great tool.

> And here's the
> big one: are you (or do you know somebody) willing to commit to
> maintaining the package for the lifetime of its inclusion into Sage?
>

Why not? Anyway, looking at the code, google or-tools are lacking of
multi platform
compiling facilities (no configure, some arch dependent code and so on).
An external spkg
(as for any new sage software inclusion) shoul be the start point.

Reply all
Reply to author
Forward
0 new messages