# Qaekwy Python Client
*Operational Research at your fingertips.*
The Qaekwy Python Client serves as a powerful tool to interact with the Qaekwy optimization
solver engine through its API. This client provides a convenient and programmatic way to
**create**, **model**, and **solve** optimization problems using Qaekwy, streamlining
the process of **formulating complex problems and finding optimal solutions**.
Qaekwy is small optimization problem solver engine designed to tackle a wide range of
real-world challenges. It provides powerful modeling capabilities and efficient solving
algorithms to find optimal solutions to complex problems.
## Features
- **Modeling Made Easy:** Define variables, constraints, and objective functions seamlessly.
Qaekwy's `Modeller` class helps you create optimization models with clarity and precision.
- **Diverse Constraint Support:** Qaekwy supports various constraint types, from simple arithmetic
to complex mathematical expressions. Create constraints that accurately represent real-world scenarios.
- **Effortless Optimization:** Qaekwy abstracts away the complexities of communication with
optimization engine. Send requests and receive responses using intuitive methods.
- **Flexibility**: You can leverage the Qaekwy Python Client to tailor optimization problems to their specific
needs by utilizing Qaekwy's modelling capabilities. This includes handling various types of constraints,
objectives, and solver algorithms.
## Installation
```shell
pip install qaekwy
```
## Documentation
Explore the [Qaekwy Documentation](https://docs.qaekwy.io) for in-depth guides, examples, and usage details.
## Example
How to use the Qaekwy Python Client to solve a very small optimization problem:
```python
from qaekwy.engine import DirectEngine
from qaekwy.model.constraint.relational import RelationalExpression
from qaekwy.model.specific import SpecificMaximum
from qaekwy.model.variable.integer import IntegerVariable
from qaekwy.model.modeller import Modeller
from qaekwy.model.searcher import SearcherType
# Define the optimization problem using Qaekwy Python Client
class SimpleOptimizationProblem(Modeller):
def __init__(self):
super().__init__()
# Create a integer variables
x = IntegerVariable(var_name="x", domain_low=0, domain_high=10)
y = IntegerVariable(var_name="y", domain_low=0, domain_high=10)
z = IntegerVariable(var_name="z", domain_low=0, domain_high=10)
# Constraints
constraint_1 = RelationalExpression(y > 2 * x)
constraint_2 = RelationalExpression(x >= 4)
constraint_3 = RelationalExpression(z == y - x)
# Objective: Maximize z
self.add_objective(
SpecificMaximum(variable=z)
)
# Add variable and constraint to the problem
self.add_variable(x)
self.add_variable(y)
self.add_variable(z)
self.add_constraint(constraint_1)
self.add_constraint(constraint_2)
self.add_constraint(constraint_3)
# Set the search strategy
self.set_searcher(SearcherType.BAB)
# Create a Qaekwy engine for interaction with the freely-available Cloud instance
qaekwy_engine = DirectEngine()
# Create the optimization problem instance
optimization_problem = SimpleOptimizationProblem()
# Request the Qaekwy engine to solve the problem
response = qaekwy_engine.model(model=optimization_problem)
# Retrieve the list of solutions from the response
list_of_solutions = response.get_solutions()
# Print the solution(s) obtained
for solution in list_of_solutions:
print(f"Optimal solution: x = {solution.x}")
print(f"Optimal solution: y = {solution.y}")
print(f"Optimal solution: z = {solution.z}")
```
Output:
```
Optimal solution: x = 4
Optimal solution: y = 10
Optimal solution: z = 6
```
## License
This software is licensed under the **European Union Public License v1.2**
Raw data
{
"_id": null,
"home_page": "https://qaekwy.io",
"name": "qaekwy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "operational research,optimization,CSP,solver,constraint,constraint programming",
"author": "Alexis LE GOADEC",
"author_email": "alex@qaekwy.io",
"download_url": "https://files.pythonhosted.org/packages/00/cd/dc690a0675bf74176fc892743704d5f1ccdb2c9cbebd5995ffbebd868793/qaekwy-0.1.4.tar.gz",
"platform": null,
"description": "# Qaekwy Python Client\n\n*Operational Research at your fingertips.*\n\nThe Qaekwy Python Client serves as a powerful tool to interact with the Qaekwy optimization\nsolver engine through its API. This client provides a convenient and programmatic way to\n**create**, **model**, and **solve** optimization problems using Qaekwy, streamlining\nthe process of **formulating complex problems and finding optimal solutions**.\n\nQaekwy is small optimization problem solver engine designed to tackle a wide range of\nreal-world challenges. It provides powerful modeling capabilities and efficient solving\nalgorithms to find optimal solutions to complex problems.\n\n\n## Features\n\n- **Modeling Made Easy:** Define variables, constraints, and objective functions seamlessly.\nQaekwy's `Modeller` class helps you create optimization models with clarity and precision.\n\n- **Diverse Constraint Support:** Qaekwy supports various constraint types, from simple arithmetic\nto complex mathematical expressions. Create constraints that accurately represent real-world scenarios.\n\n- **Effortless Optimization:** Qaekwy abstracts away the complexities of communication with\noptimization engine. Send requests and receive responses using intuitive methods.\n\n- **Flexibility**: You can leverage the Qaekwy Python Client to tailor optimization problems to their specific\nneeds by utilizing Qaekwy's modelling capabilities. This includes handling various types of constraints,\nobjectives, and solver algorithms.\n\n\n## Installation\n\n```shell\npip install qaekwy\n```\n\n\n## Documentation\n\nExplore the [Qaekwy Documentation](https://docs.qaekwy.io) for in-depth guides, examples, and usage details.\n\n\n## Example\n\nHow to use the Qaekwy Python Client to solve a very small optimization problem:\n\n```python\nfrom qaekwy.engine import DirectEngine\nfrom qaekwy.model.constraint.relational import RelationalExpression\nfrom qaekwy.model.specific import SpecificMaximum\nfrom qaekwy.model.variable.integer import IntegerVariable\nfrom qaekwy.model.modeller import Modeller\nfrom qaekwy.model.searcher import SearcherType\n\n# Define the optimization problem using Qaekwy Python Client\nclass SimpleOptimizationProblem(Modeller):\n def __init__(self):\n super().__init__()\n\n # Create a integer variables\n x = IntegerVariable(var_name=\"x\", domain_low=0, domain_high=10)\n y = IntegerVariable(var_name=\"y\", domain_low=0, domain_high=10)\n z = IntegerVariable(var_name=\"z\", domain_low=0, domain_high=10)\n\n # Constraints\n constraint_1 = RelationalExpression(y > 2 * x)\n constraint_2 = RelationalExpression(x >= 4)\n constraint_3 = RelationalExpression(z == y - x)\n\n # Objective: Maximize z\n self.add_objective(\n SpecificMaximum(variable=z)\n )\n\n # Add variable and constraint to the problem\n self.add_variable(x)\n self.add_variable(y)\n self.add_variable(z)\n self.add_constraint(constraint_1)\n self.add_constraint(constraint_2)\n self.add_constraint(constraint_3)\n\n # Set the search strategy\n self.set_searcher(SearcherType.BAB)\n\n# Create a Qaekwy engine for interaction with the freely-available Cloud instance\nqaekwy_engine = DirectEngine()\n\n# Create the optimization problem instance\noptimization_problem = SimpleOptimizationProblem()\n\n# Request the Qaekwy engine to solve the problem\nresponse = qaekwy_engine.model(model=optimization_problem)\n\n# Retrieve the list of solutions from the response\nlist_of_solutions = response.get_solutions()\n\n# Print the solution(s) obtained\nfor solution in list_of_solutions:\n print(f\"Optimal solution: x = {solution.x}\")\n print(f\"Optimal solution: y = {solution.y}\")\n print(f\"Optimal solution: z = {solution.z}\")\n```\n\nOutput:\n\n```\nOptimal solution: x = 4\nOptimal solution: y = 10\nOptimal solution: z = 6\n```\n\n## License\n\nThis software is licensed under the **European Union Public License v1.2**\n",
"bugtrack_url": null,
"license": "European Union Public Licence 1.2 (EUPL 1.2)",
"summary": "Python Client library for Qaekwy Operational Research Solver",
"version": "0.1.4",
"project_urls": {
"Documentation": "https://docs.qaekwy.io",
"Github": "https://github.com/alex-87/qaekwy-python",
"Homepage": "https://qaekwy.io",
"Issues tracker": "https://github.com/alex-87/qaekwy-python/issues"
},
"split_keywords": [
"operational research",
"optimization",
"csp",
"solver",
"constraint",
"constraint programming"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "72c91fdc984d7edf639df140b54afe960f84288d13d2a6fa310e08aa02edb1c3",
"md5": "7f173441536a0f271461c3d3c8f73cc0",
"sha256": "5ca501687b3fc93d61d3c83ee7492e2e012a4c8f8c15268c3995614ec19f87a4"
},
"downloads": -1,
"filename": "qaekwy-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7f173441536a0f271461c3d3c8f73cc0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 49629,
"upload_time": "2023-09-02T12:33:17",
"upload_time_iso_8601": "2023-09-02T12:33:17.933602Z",
"url": "https://files.pythonhosted.org/packages/72/c9/1fdc984d7edf639df140b54afe960f84288d13d2a6fa310e08aa02edb1c3/qaekwy-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "00cddc690a0675bf74176fc892743704d5f1ccdb2c9cbebd5995ffbebd868793",
"md5": "f72f9b9d3c744db42a7baf3c4d5cb058",
"sha256": "3a173ce97baaf90b44a42ec05ce7ea64ed7321381265ca3ca0a832147f01b54b"
},
"downloads": -1,
"filename": "qaekwy-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "f72f9b9d3c744db42a7baf3c4d5cb058",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 32641,
"upload_time": "2023-09-02T12:33:19",
"upload_time_iso_8601": "2023-09-02T12:33:19.614698Z",
"url": "https://files.pythonhosted.org/packages/00/cd/dc690a0675bf74176fc892743704d5f1ccdb2c9cbebd5995ffbebd868793/qaekwy-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-02 12:33:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "alex-87",
"github_project": "qaekwy-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "qaekwy"
}