Documentation: new examples and reference manual

6,371 views
Skip to first unread message

Laurent Perron

unread,
Jun 4, 2016, 12:49:33 PM6/4/16
to or-tools-discuss
Hi all. 

We've added more content to our documentation hub: short tutorials on how to solve integer programming problems, job shop problems, and vehicle routing problems with time windows. We've also added over 800 pages of comprehensive documentation detailing our C++ API. (That documentation is automatically generated, so the formatting will be odd in places.)

We'll be adding plenty more content in the months to come. If you have specific requests, let us know!

kaveh azizian

unread,
Jun 30, 2016, 3:17:32 AM6/30/16
to or-tools-discuss
I got this error when I was trying to run make third_party to install or-tools from source files:
Can't open y.tab.[ch]: No such file or directory.
Makefile:4133: recipe for target 'src/parse-gram.c' failed
make: *** [src/parse-gram.c] Error 127

help plz

Sunshine Free

unread,
Jul 10, 2016, 6:25:59 PM7/10/16
to or-tools-discuss
Hi,

   How to solve a GTSP with the Or-tool?

Driss Lahlou

unread,
Jul 19, 2016, 9:40:23 AM7/19/16
to or-tools...@googlegroups.com
Hello kaveh,
I had the same error today, for some odd reason, bison was not well installed, and then I started over :
make clean_third_party
make third_party
It worked fine for me.
Hope this helps.
Regards


--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

driss

Michael Powell

unread,
Sep 23, 2016, 5:41:49 PM9/23/16
to or-tools-discuss


On Saturday, June 4, 2016 at 12:49:33 PM UTC-4, Laurent Perron wrote:
Hi all. 

We've added more content to our documentation hub: short tutorials on how to solve integer programming problems, job shop problems, and vehicle routing problems with time windows. We've also added over 800 pages of comprehensive documentation detailing our C++ API. (That documentation is automatically generated, so the formatting will be odd in places.)

I am trying to find out what the parameters mean in the MakeMinimize documentation:


Intuitively, I have thoughts about what a "minimize" objective function means; but I don't really know, based on sparse documentation.

Also, what is "step"?

Driss Lahlou

unread,
Sep 27, 2016, 5:28:56 AM9/27/16
to or-tools...@googlegroups.com
Hi Michael,

MakeMinimize will return an OptimizeVar which will define the sense of optimization. If you use MakeMinimize, the solver will tend to assign the minimum possible value to OptimizeVar respecting the constraints (vice versa for MakeMaximize). The OptimizeVar is then used by DecisionBuilder (It decides which variables and values to branch on).

Step is the value by which the DecisionBuilder increments or decrements the values of the variables during branching.

I hope this helps.

Regards,

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

driss
Message has been deleted

Shammya Saha

unread,
May 30, 2017, 12:31:37 AM5/30/17
to or-tools-discuss
Hey 
Is there any PDF documentation regarding the solving techniques such as the algorithms used to solve the minimum or maximum cash flow problem? 

Jon Orwant

unread,
May 30, 2017, 4:21:49 PM5/30/17
to or-tools-discuss

--

Teresa Lopez

unread,
Aug 25, 2017, 8:53:41 AM8/25/17
to or-tools-discuss
Hi Laurent!

I am wondering if you could help me out a little bit regarding how to use or tools in python. 
I am trying to solve one routing problem CVRPTW with the pywrapcp file. 
What i need to do is: use the search_parameters of the first solution strategy as input to  the 
local_search_heuristic and then optimize them. 

i have already try this two lines of code:

      routing = pywrapcp.RoutingModel(num_locations, num_vehicles, 0) # By default all routes start at node 0 = Depot
      search_parameters = pywrapcp.RoutingModel_DefaultSearchParameters()

search_parameters.first_solution_strategy = (routing_enums_pb2.FirstSolutionStrategy.PARALLEL_CHEAPEST_INSERTION)
search_parameters.local_search_metaheuristic = (routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH)
      search_parameters.time_limit_ms = search_time_limit * 1000

But it doesnt work since I think that by doing this, i am not saying that my input for the LocalSearchHeuristic  is the one given by the firstSolutionStrategy
How i can do this?

Kindest Regards 

Vincent Furnon

unread,
Aug 25, 2017, 8:56:16 AM8/25/17
to or-tools...@googlegroups.com
As I replied elsewhere, the settings you mentioned will make the solver find a first solution with PARALLEL_CHEAPEST_INSERTION, then improve it with GUIDED_LOCAL_SEARCH. Isn't that exactly what you want to do ?
Note that you will need to specify a time limit as the search will run for ever otherwise:
search_parameters.time_limit_ms = 10000

--

Teresa Lopez

unread,
Aug 28, 2017, 5:19:40 AM8/28/17
to or-tools-discuss
Yes, I have already done that. But I can't see any improvement when using PCI alone or adding GLS....

How can i see the improvement in the solution? I mean, how can I print out the ObjectiveValue with the search parameters before they are introduced into the Metaheuristic Phase???? So i can verify that indeed there is a improvement within the same instance run at the same time. Since it is impossible to verify it by running them lin parallel due to the stochastic behavior of the search method. 

Kindest Regards 
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.

david Escher

unread,
Oct 24, 2017, 6:17:15 AM10/24/17
to or-tools-discuss
Hi

In those 800 pages, is there a list of all the constraints anywhere? I know they are in the source https://github.com/google/or-tools/blob/master/ortools/constraint_solver/constraint_solver.h starting at line 1272, but I can't find them in the reference. If you like to view this as a specific request, I would love for there to just be a list of all the constraints, and how to call them in the supported languages. (you can probably make 2-3 line auto-generated examples that would help a lot)

Also, I am trying to invoke the Element constraint in some form python, for example the method on line 1207 in that same source file. However, I get an argument missmatch which I think is caused by my lack of std::vectors. What should I do?

Minimal test case in pyhon 2.7:

A=solver.IntVar(0,4,"var")
solver.Element([1,2,3],A)

Error I get (on ubuntu mate 16.04, 64 bit):

NotImplementedError: Wrong number or type of arguments....

Laurent Perron

unread,
Oct 24, 2017, 9:32:19 AM10/24/17
to or-tools-discuss
Unfortunately, Python does not copy documentation from the C++ to the python code.

For the element, 

solver.Element(index, [array]) returns an expression, the same as index.IndexOf(array)
solver.ElementConstraint(index, [array], target) creates the constraint.

Thanks

Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00


--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discuss+unsubscribe@googlegroups.com.

david Escher

unread,
Nov 1, 2017, 7:21:09 AM11/1/17
to or-tools-discuss
Hi,

I tried to invoke the constraint as described but still can't get it to work. The way I understand things this code:

  A = solver.IntVar(0, 10, "A")
  B = solver.IntVar(0, 10, "B")
  array = [1,2,3]
  solver.Add(A.indexOf(array)== B)

should run just fine, but it gives me this error:

Traceback (most recent call last):
  File "element.py", line 42, in <module>
    main()
  File "element.py", line 14, in main
    solver.Add(A.indexOf(array)== B)
  File "/usr/local/lib/python2.7/dist-packages/ortools/constraint_solver/pywrapcp.py", line 1481, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, IntVar, name)
  File "/usr/local/lib/python2.7/dist-packages/ortools/constraint_solver/pywrapcp.py", line 74, in _swig_getattr
    return _swig_getattr_nondynamic(self, class_type, name, 0)
  File "/usr/local/lib/python2.7/dist-packages/ortools/constraint_solver/pywrapcp.py", line 69, in _swig_getattr_nondynamic
    return object.__getattr__(self, name)
AttributeError: type object 'object' has no attribute '__getattr__'

I also tried replacing the last line with:

  solver.ElementConstraint(A,array,B)

and

  solver.ElementConstraint(A,[array],B)

Which gives me a similar error. What am I doing wrong and how do I fix it?
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.

manoj kumar

unread,
Sep 18, 2018, 12:25:48 PM9/18/18
to or-tools-discuss
Team,

Could you please provide any info regarding the 32bit dll available for the or-tools. Or share any link to generate the 32 bit dll for the or-tools


What is the difference between 32 bit dll and 64 bit dll of google or-tools. Is there any performance impact?.which is recommended to use...kindly provide your suggestions.

Laurent Perron

unread,
Sep 18, 2018, 2:14:35 PM9/18/18
to or-tools-discuss
Definitely 64 bit. All integer computations are done in 64 bit.

And some problems do use more than a few GB. 

About compiling, we now use DotNet core to compile everything. I am not sure it supports 32 bit anymore. 

--Laurent


Reply all
Reply to author
Forward
0 new messages