Package: qaekwy
Qaekwy Python ClientOperational 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 tocreate,model, andsolveoptimization problems using Qaekwy, streamlining
the process offormulating 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.FeaturesModeling Made Easy:Define variables, constraints, and objective functions seamlessly.
Qaekwy'sModellerclass 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.InstallationpipinstallqaekwyDocumentationExplore theQaekwy Documentationfor in-depth guides, examples, and usage details.ExampleHow to use the Qaekwy Python Client to solve a very small optimization problem:fromqaekwy.engineimportDirectEnginefromqaekwy.model.constraint.relationalimportRelationalExpressionfromqaekwy.model.specificimportSpecificMaximumfromqaekwy.model.variable.integerimportIntegerVariablefromqaekwy.model.modellerimportModellerfromqaekwy.model.searcherimportSearcherType# Define the optimization problem using Qaekwy Python ClientclassSimpleOptimizationProblem(Modeller):def__init__(self):super().__init__()# Create a integer variablesx=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)# Constraintsconstraint_1=RelationalExpression(y>2*x)constraint_2=RelationalExpression(x>=4)constraint_3=RelationalExpression(z==y-x)# Objective: Maximize zself.add_objective(SpecificMaximum(variable=z))# Add variable and constraint to the problemself.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 strategyself.set_searcher(SearcherType.BAB)# Create a Qaekwy engine for interaction with the freely-available Cloud instanceqaekwy_engine=DirectEngine()# Create the optimization problem instanceoptimization_problem=SimpleOptimizationProblem()# Request the Qaekwy engine to solve the problemresponse=qaekwy_engine.model(model=optimization_problem)# Retrieve the list of solutions from the responselist_of_solutions=response.get_solutions()# Print the solution(s) obtainedforsolutioninlist_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 = 6LicenseThis software is licensed under theEuropean Union Public License v1.2