diff --git a/documentation/changes_list.txt b/documentation/changes_list.txt index d1908e8dbc..eacdc39cd7 100644 --- a/documentation/changes_list.txt +++ b/documentation/changes_list.txt @@ -1,4 +1,33 @@ +v.0.1.3: (2012-04-20 11:29:46) +------------------------------ +* Minor enhancements to the manual: + - preface added (suggested by Hakan). + - parts introduced: + + basics, + + customization, + + routing, + + appendices. + - no more unnecessary empty pages in the LaTeX version (still "belle page"). + - two pages mode. + - chapter about "Modeling tricks" put at the end in the appendices. + - few corrections. + - chap2: suggestions from Hakan (thank you) applied: + + typos. + + nqueens -> n-queens. + + chap2: solution in same format as problem. + + lots of small improvements. + - tables centred. + - tags "draft" and "final" added in Sphinx for conditional compilation. +* Minor enhancements to the slides: + - chap2: few typos, better layout (thank you Dania). +* FAQ on the documentation extended. +* Tutorial examples: + - code directories changed (now they all start with lower case letter). + - minor corrections in the C++ code. + - Csharp examples for chap2 added. + - Java examples for chap2 added. + v.0.1.2: (2012-03-30 21:13:04) ------------------------------ * Minor enhancements to the manual: diff --git a/documentation/documentation_hub.html b/documentation/documentation_hub.html index f535ba92fd..5095086cf7 100644 --- a/documentation/documentation_hub.html +++ b/documentation/documentation_hub.html @@ -39,8 +39,7 @@
We are working hard to provide useful documentation. The documentation is distributed in several documents: - +
We are working hard to provide useful documentation. The documentation is distributed in several documents:
You can find more details about these documents in the foreword of the manual.
+The or-tools documentation is covered by the Apache License 2.0.
Here is a little summary: -
v.0.1.2: (2012-03-30 21:13:04) +- - -Here is a little summary:
+v.0.1.3: (2012-04-20 11:29:46) ------------------------------ * Minor enhancements to the manual: - - conditional compilation in LaTeX: - code doesn't overflow anymore in A4 mode... + - preface added (suggested by Hakan). + - parts introduced: + + basics, + + customization, + + routing, + + appendices. + - no more unnecessary empty pages in the LaTeX version (still "belle page"). + - two pages mode. + - chapter about "Modeling tricks" put at the end in the appendices. - few corrections. -* Hub: - - we recommend calibre as Cross-platform ebook viewer. -* Tutorials: - - tutorial_all_examples.zip added. -* Lab sessions: - - chap2 added. - -
This is the list of changes.
+ - chap2: suggestions from Hakan (thank you) applied: + + typos. + + nqueens -> n-queens. + + chap2: solution in same format as problem. + + lots of small improvements. + - tables centred. + - tags "draft" and "final" added in Sphinx for conditional compilation. +* Minor enhancements to the slides: + - chap2: few typos, better layout (thank you Dania). +* FAQ on the documentation extended. +* Tutorial examples: + - code directories changed (now they all start with lower case letter). + - minor corrections in the C++ code. + - Csharp examples for chap2 added. + - Java examples for chap2 added. +The epub version is still experimental. We recommend calibre to view the epub version. With this version, you should be able to convert the manual to the right format for your preferred handheld device.
+ +| Part I: Basics | +|
|---|---|
| Chap1: Introduction | +
+
+
+
+ 5%
+
+ |
+
| Chap2: First steps with or-tools | +
+
+
+
+ 82%
+
+ |
+
| Chap3: Using objectives | +
+
+
+
+ 63%
+
+ |
+
| Chap4: Search primitives | +
+
+
+
+ 9%
+
+ |
+Part II: Customization | +
| Chap5: Large Neighbourhood Search | +
+
+
+
+ 0%
+
+ |
+
| Chap6: Local Search operators | +
+
+
+
+ 0%
+
+ |
+
| Chap7: Custom constraints | +
+
+
+
+ 0%
+
+ |
+Part III: Routing | +
| Chap8: TSP with constraints | +
+
+
+
+ 0%
+
+ |
+
| Chap9: VRP with constraints | +
+
+
+
+ 0%
+
+ |
+Part IV: Appendices | +
| Chap10: Utilities | +
+
+
+
+ 2%
+
+ |
+
| Chap11: Modeling tricks | +
+
+
+
+ 0%
+
+ |
+
You can download all the code at once or pick a single file in the list below. All files are encoded in UTF-8 and we use LF (Unix) newlines.
+You can download all the code at once or pick a single file in the list below. All files are encoded in UTF-8 and we use LF (Unix) newlines (the code is cross-platform though).
+The code is not well documented inside the source files as we explain it in great details in the user's manual. Some files don't have corresponding +files in some languages as the features implemented just don't have an equivalent in that languages (for instance, the Google gflags library is missing in Java and C#).
++
+
Everything: tutorial_all_examples.zip
- -
For the moment, contact us on the mailing list. We will implement -an interactive documentation... if we have enough time. First we document, than we improve the documentation. ;-)
+Send us your comments, suggestions, corrections, feedback, ... to ortools.doc at gmail.com. Thank you very much.
We give you the easiest solutions to compile and run the examples or your -code in any directory you want.
-C++:
-the easiest way is probably to declare the main directory of the -or-tools library in the PYTHONPATH variable. python will then automatically find all the pieces of the library.
-Makefiles are (will be) provided to compile the examples (soon).
Maybe becauze it iz my third language? We are always trying to improve our work. If you have comments, suggestions, corrections,... -see I’d like to improve a section in the documentation. How do I contribute?
+see I’d like to improve a section in the documentation. How do I contribute?.All the necessary steps are explained in the little manual howto.pdf in the directory documentation/doc of the or-tools project. The document itself is written +in LaTeX and can be generated with pdflatex.
+The documentation is written for the most part in reStructuredText (see http://docutils.sourceforge.net/rst.html) +and transformed with the help of the following great open source tools:
+You will find more details in the little manual howto.pdf in the directory documentation/doc of the or-tools project.
+We are more focused on the content for the moment. Writing documentation is a two-step process: first, we write the documentation, +then we format the documents.
+You can send us your comments about the layout (see I’d like to improve a section in the documentation. How do I contribute?). We might not correct the layout right away but we’ll +keep your suggestions for later.
+This is probably the most difficult to write chapter and will be written last.
+This chapter will be an introduction to Constraint Programming and... the manual. Expect to see some common concepts explained here. If +you see important notions in the other chapters that are not explained, this is because we will detail them in this first chapter.
+Not for the moment. +Give us some time. For the moment, the structure of the documentation is still changing and the documentation is quite empty.
+Yes! The code we have released is a subset of all the OR tools we are +developing at Google. This code is used internally. We will maintain +this open-source branch in sync with our internal code and will likely +contribute more tools, more technology.
|
+ - |
|
+1. Introduction to CP
+2. First steps with or-tools
+3. Using objectives
+4. Search primitives
+
+5. Large Neighbourhood Search
+6. Local Search operators
+7. Custom constraints
+
+8. TSP with constraints
+9. VRP with constraints
+
+10. Utilities
+11. Modeling tricks
+
+1. Introduction to CP
+2. First steps with or-tools
+3. Using objectives
+4. Search primitives
+
+5. Large Neighbourhood Search
+6. Local Search operators
+7. Custom constraints
+
+8. TSP with constraints
+9. VRP with constraints
+
+10. Utilities
+11. Modeling tricks
+
The header logging.h is needed for some logging facilities and some assert-like macros. The header constraint_solver.h is the main entry point -to the CP solver and must be included whenever you intend to use it.
+to the CP solver and must be includedfootnote{Directly or indirectly when it is included in another header you include.} whenever you intend to use it.The CP solver is the main engine to solve an +
The CP solver is the main engine to solve a problem instance. It is also responsible for the creation of the model. It has a very rich Application Programming Interface (API) and provides a lots of functionalities.
@@ -153,8 +153,15 @@ them appropriately.Warning
Never delete explicitly an object created by -a factory method!
+a factory method! First, the solver deletes all the objects for you. +Second, deleting a pointer twice in C++ gives undefined behaviour[2]!| [2] | It is possible to bypass the undefined behaviour but you don’t know what the solver needs to do, so keep your hands off of the object pointers! ;-) |
Beside integer variables, the solver provides factory methods to create interval variables (IntervalVar), sequence variables (SequenceVar) and variables to encapsulate objectives (OptimizeVar).
@@ -177,11 +184,11 @@ AbortedIn Asserting, we cover assert-like macros in more details.
To create a integer linear constraint, we need to know how to multiply an integer variable with an integer constant and how to add two integer variables. We have seen that the solver creates a variable and only provides a pointer to that variable. -The solver provides also factory methods to multiply an integer coefficient by +The solver also provides factory methods to multiply an integer coefficient by an IntVar given by a pointer:
IntVar* const var1 = solver.MakeIntVar(0, 1, "Var1");
IntVar* const var2 = solver.MakeProd(var1,36)->Var();
@@ -202,7 +209,7 @@ again a factory method:
Is the call to Var() really necessary?
Yes! Var() not only transforms a constraint into a variable but
also a stateless expression into a stateful and monotonic variable.
-Variables are stateful objects that provide a rich API. On the other hand, subclasses of BaseIntExpr represent range-only stateless objects. That is, MakeMin(MakeSum(A,B),a) is recomputed each time as MakeMin(A,a) + MakeMin(B,a). Furthermore, sometimes the propagation on an expression is not complete. For instance, if A is an IntVar with domain [0 .. 5], and B another IntVar with domain [0 .. 5] then MakeSum(A, B) has domain [0, 10]. If we apply MakeMax(MakeSum(A, B), 4)) then we will deduce that both A and B will have domain [0 .. 4]. In that case, the max of MakeMax(MakeSum(A, B),4) is 8 and not 4. To get back monotonicity, we need to cast the expression into a variable using the Var() method: MakeMax(MakeSum(A, B),4)->Var(). The resulting variable is stateful and monotonic.
+Variables are stateful objects that provide a rich API. On the other hand, subclasses of BaseIntExpr represent range-only stateless objects. That is, MakeMin(MakeSum(A,B),a) is recomputed each time as MakeMin(A,a) + MakeMin(B,a). Furthermore, sometimes the propagation on an expression is not complete. For instance, if A is an IntVar with domain [0..5], and B another IntVar with domain [0..5] then MakeSum(A, B) has domain [0, 10]. If we apply MakeMax(MakeSum(A, B), 4)) then we will deduce that both A and B will have domain [0..4]. In that case, the max of MakeMax(MakeSum(A, B),4) is 8 and not 4. To get back monotonicity, we need to cast the expression into a variable using the Var() method: MakeMax(MakeSum(A, B),4)->Var(). The resulting variable is stateful and monotonic.
Warning
@@ -218,7 +225,7 @@ also a stateless expression into a stateful and monotonic variable. IntVar* const term2 = solver.MakeSum(solver.MakeProd(i,kBase),s)->Var();No need to cast the result of MakeProd(c,kBbase) into an IntVar because +
There is no need to cast the result of MakeProd(c,kBbase) into an IntVar because MakeSum() takes two pointers to an IntExpr.
The combination of MakeSum() and MakeProd() can quickly become tedious. We use helper functions to construct sums. For example, to construct the first @@ -329,7 +336,15 @@ a solution was found and false<< "F=" << f->Value() << " " << "U=" << u->Value() << " " << "N=" << n->Value() << " " << "T=" << t->Value() << " " << "R=" << r->Value() << " " << "E=" << e->Value(); -... + + // Is CP + IS + FUN = TRUE? + CHECK_EQ(p->Value() + s->Value() + n->Value() + + kBase * (c->Value() + i->Value() + u->Value()) + + kBase * kBase * f->Value(), + e->Value() + + kBase * u->Value() + + kBase * kBase * r->Value() + + kBase * kBase * kBase * t->Value()); } else { LOG(INFO) << "Cannot solve problem."; } // if (solver.NextSolution()) @@ -340,6 +355,8 @@ a solution was found and false
We check the validity of the solution after printing: if the solution is not valid, we can see what +was found by the solver.
To obtain all the solutions, NextSolution() can be called repeatedly:
while (solver.NextSolution()) {
// Do something with the current solution
@@ -394,9 +411,9 @@ $[23:51:34] examples/cp_is_fun1.cc:133: C=2 P=3 I=7 S=4 F=9 U=6 N=8 T=1
Welcome
@@ -408,8 +425,8 @@ $[23:51:34] examples/cp_is_fun1.cc:133: C=2 P=3 I=7 S=4 F=9 U=6 N=8 T=1
@@ -448,7 +465,7 @@ $[23:51:34] examples/cp_is_fun1.cc:133: C=2 P=3 I=7 S=4 F=9 U=6 N=8 T=1
One solution is C=2 P=3 I=7 S=4 F=9 U=6 N=8 T=1 R=0 E=5 because -23+74+968 = 1065. Ideally, a good cryptarithmetic puzzle must have only +
One solution is C=2 P=3 I=7 S=4 F=9 U=6 N=8 T=1 R=0 E=5 because
+ 2 3
++ 7 4
++ 9 6 8
+---------
+= 1 0 6 5
+Ideally, a good cryptarithmetic puzzle must have only one solution[1]. We derogate from this tradition. The above example has multiple solutions. We use it to show you how to collect all solutions of a problem.