[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-28 UTC."],[[["\u003cp\u003eGoogle's OR-Tools provides the MPSolver for solving linear programming (LP) and mixed integer programming (MIP) problems.\u003c/p\u003e\n"],["\u003cp\u003eThe CP-SAT solver can be used for pure integer programming problems.\u003c/p\u003e\n"],["\u003cp\u003eOR-Tools offers various examples demonstrating MPSolver usage with different solvers like Glop and SCIP for LP, MIP, bin packing, and assignment problems.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can control the search time limit for solvers using the \u003ccode\u003eset_time_limit\u003c/code\u003e function across different programming languages like Python, C++, Java, and C#.\u003c/p\u003e\n"]]],["OR-Tools offers MPSolver for linear and mixed integer programming, and CP-SAT for pure integer programming. It provides examples for solving problems like the Stigler diet, LP and MIP problems, bin packing, and assignment. Common tasks include setting search time limits, demonstrated with `set_time_limit` methods in Python, C++, Java, and C#; the example shows how to set the limit to 15 milliseconds. MPSolver can be used with Glop or SCIP.\n"],null,["# MPSolver Interface\n\nGoogle's open source software suite for optimization,\n[OR-Tools](https://github.com/google/or-tools), provides the MPSolver wrapper\nfor solving [linear programming](/optimization/lp) and\n[mixed integer programming](/optimization/mip) problems.\n\nTo solve pure integer programming problems you can also use the\n[CP-SAT](/optimization/cp/cp_solver) solver.\n\nExamples\n--------\n\nThe following pages provide examples that illustrate MPSolver usage:\n\n- [Solving the Stigler diet problem](/optimization/lp/stigler_diet) using Glop\n- [Solving an LP problem](/optimization/lp/lp_example) using Glop\n- [Solving a MIP problem](/optimization/mip/mip_example) using SCIP\n- [Solving a bin packing problem](/optimization/pack/bin_packing) using SCIP\n- [Solving an assignment problem](/optimization/assignment/assignment_example) using CP-SAT\n- [Using arrays to define a model](/optimization/mip/mip_var_array)\n\nCommon tasks\n------------\n\nThe following section demonstrates common tasks related to solving\nand .\n\n### Time limits\n\nThe example below shows how to set a search time limit of 15 milliseconds when\nusing . \n\n### Python\n\n```python\nsolver.set_time_limit(15)\n```\n\n### C++\n\n```c++\nsolver-\u003eset_time_limit(15);\n```\n\n### Java\n\n```java\nsolver.setTimeLimit(15)\n```\n\n### C#\n\n```c#\nsolver.SetTimeLimit(15);\n```\n\n*[Glop]: Google Linear Optimization\n*[MIPs]: Mixed Integer Programming\n*[LPs]: Linear Programming"]]