diff --git a/examples/cpp/README b/examples/cpp/README deleted file mode 100644 index b1ad7fd2f2..0000000000 --- a/examples/cpp/README +++ /dev/null @@ -1,55 +0,0 @@ - C++ examples to demonstrate usage of the different -Operations Research libraries. - - - Constraint Solver examples: - - cryptarithm.cc Demonstrates the use of basic modeling objects - (integer variables, arithmetic constraints and expressions, - simple search). - - golomb.cc Demonstrates how to handle objective functions and collect - solutions found during the search. - - magic_square.cc Shows how to use the automatic search to solve your - problem. - - costas_array.cc Solves the problem of Costas Array (a constrained - assignment problem used for radars) with two version. On version is - a feasibility version with hard constraints, the other version is - an optimization version with soft constraints and violation costs. - - jobshop.cc Demonstrates scheduling of jobs on different machines. - - jobshop_ls.cc Demonstrates scheduling of jobs on different machines with - a search using Local Search and Large Neighorhood Search. - - nqueens.cc Solves the n-queen problem. It also demonstrates how to break - symmetries during search. - - network_routing.cc Solves a multicommodity mono-routing - problem with capacity constraints and a max usage cost structure. - - sports_scheduling.cc Finds a soccer championship schedule. Its uses an - original approach where all constraints attached to either one team, - or one week are regrouped into one global 'AllowedAssignment' constraints. - - dobble_ls.cc Shows how to write Local Search operators and Local Search - filters in a context of an assignment/partitioning problem. It also - shows how to write a simple constraint. - - - Routing examples: - - tsp.cc Travelling Salesman Problem. - - cvrptw.cc Capacitated Vehicle Routing Problem with Time Windows. - - pdptw.cc Pickup and Delivery Problem with Time Windows. - - - Graph examples: - - flow_api.cc Demonstrates how to use Min-Cost Flow and Max-Flow api. - - linear_assignment_api.cc Demonstrates how to use the Linear Sum - Assignment solver. - - dimacs_assignment.cc Solves DIMACS challenge on assignment - problems. - - - Linear and integer programming examples: - - linear_programming.cc Demonstrates how to use the linear solver - wrapper API to solve Linear Programming problems. - - integer_programming.cc Demonstrates how to use the linear solver - wrapper API to solve Integer Programming problems. - - linear_solver_protocol_buffers.cc Demonstrates how protocol - buffers can be used as input and output to the linear solver wrapper. - - strawberry_fields_with_column_generation.cc Complex example that - demonstrates how to use dynamic column generation to solve a 2D - covering problem. - - - Utilities - - model_util.cc A utility to manipulate model files (.cp) dumped by the - solver. diff --git a/examples/cpp/README.md b/examples/cpp/README.md new file mode 100644 index 0000000000..f4aa1d0b88 --- /dev/null +++ b/examples/cpp/README.md @@ -0,0 +1,64 @@ +# C++ examples +The following examples showcase how to use the different Operations Research libraries. + +## Examples list +- Constraint Solver examples: + - cryptarithm.cc Demonstrates the use of basic modeling objects + (integer variables, arithmetic constraints and expressions, + simple search). + - golomb.cc Demonstrates how to handle objective functions and collect + solutions found during the search. + - magic_square.cc Shows how to use the automatic search to solve your + problem. + - costas_array.cc Solves the problem of Costas Array (a constrained + assignment problem used for radars) with two version. On version is + a feasibility version with hard constraints, the other version is + an optimization version with soft constraints and violation costs. + - jobshop.cc Demonstrates scheduling of jobs on different machines. + - jobshop_ls.cc Demonstrates scheduling of jobs on different machines with + a search using Local Search and Large Neighorhood Search. + - nqueens.cc Solves the n-queen problem. It also demonstrates how to break + symmetries during search. + - network_routing.cc Solves a multicommodity mono-routing + problem with capacity constraints and a max usage cost structure. + - sports_scheduling.cc Finds a soccer championship schedule. Its uses an + original approach where all constraints attached to either one team, + or one week are regrouped into one global 'AllowedAssignment' constraints. + - dobble_ls.cc Shows how to write Local Search operators and Local Search + filters in a context of an assignment/partitioning problem. It also + shows how to write a simple constraint. + +- Routing examples: + - tsp.cc Travelling Salesman Problem. + - cvrptw.cc Capacitated Vehicle Routing Problem with Time Windows. + - pdptw.cc Pickup and Delivery Problem with Time Windows. + +- Graph examples: + - flow_api.cc Demonstrates how to use Min-Cost Flow and Max-Flow api. + - linear_assignment_api.cc Demonstrates how to use the Linear Sum + Assignment solver. + - dimacs_assignment.cc Solves DIMACS challenge on assignment + problems. + +- Linear and integer programming examples: + - linear_programming.cc Demonstrates how to use the linear solver + wrapper API to solve Linear Programming problems. + - integer_programming.cc Demonstrates how to use the linear solver + wrapper API to solve Integer Programming problems. + - linear_solver_protocol_buffers.cc Demonstrates how protocol + buffers can be used as input and output to the linear solver wrapper. + - strawberry_fields_with_column_generation.cc Complex example that + demonstrates how to use dynamic column generation to solve a 2D + covering problem. + +- Utilities + - model_util.cc A utility to manipulate model files (.cp) dumped by the + solver. + +# Execution +Running the examples will involve building them, then running them. +You can run the following command from the **top** directory: +```shell +make build SOURCE=examples/cpp/.cc +make run SOURCE=examples/cpp/.cc +``` diff --git a/examples/dotnet/README.md b/examples/dotnet/README.md index 0ad3524657..2e341c0caf 100644 --- a/examples/dotnet/README.md +++ b/examples/dotnet/README.md @@ -9,12 +9,12 @@ keep up-to-date with the latest frameworks. Wherever you have or-tools installed, be sure to `PackageReference` the `Google.OrTools` from the project file. -## Execution +# Execution Running the examples will involve building them, then running them. You can run the following command: ```shell -dotnet build examples/dotnet/.csproj -dotnet run --no-build --project examples/dotnet/.csproj +dotnet build .csproj +dotnet run --no-build --project .csproj ``` # Note on Google.OrTools.FSharp @@ -34,7 +34,7 @@ Two input formats are allowed: Running the examples will involve building them, then running them. You can run the following command: ```shell -dotnet build examples/dotnet/.fsproj -dotnet run --no-build --project examples/dotnet/.fsproj +dotnet build .fsproj +dotnet run --no-build --project .fsproj ``` diff --git a/examples/java/README.md b/examples/java/README.md new file mode 100644 index 0000000000..4fff7a60a8 --- /dev/null +++ b/examples/java/README.md @@ -0,0 +1,10 @@ +# Java examples +The following examples showcase how to use the different Operations Research libraries. + +# Execution +Running the examples will involve building them, then running them. +You can run the following command from the **top** directory: +```shell +make build SOURCE=examples/java/.java +make run SOURCE=examples/java/.java +``` diff --git a/examples/python/README.md b/examples/python/README.md new file mode 100644 index 0000000000..6591c419fb --- /dev/null +++ b/examples/python/README.md @@ -0,0 +1,15 @@ +# Python examples +The following examples showcase how to use OrTools. +These examples should work for both Python2.7+ and Python3.5+. + +We recommend that all projects you create target `Python 3.7`, +as this allows you to keep up-to-date with the latest Python frameworks. + +Wherever you have `ortools` package installed, be sure to import it from your python file. + +# Execution +For running the examples you can use the the following command: +```shell +python -m pip install --upgrade --user ortools +python .py +```