Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
139e51c
feat: add LP / MIP Problems to backend, add google OR-Tools MIP Probl…
tubadzin Mar 10, 2025
7e2e249
feat: add OR-Tools MIP wrapper using build-in cbc solver
tubadzin Mar 10, 2025
93d038c
feat: add CPLEX converter from and to .lp and .mps files
tubadzin Mar 10, 2025
f789971
chore: add paths for OR-Tools solvers
tubadzin Mar 10, 2025
c50ef0f
refactor: remove unused statements
tubadzin Mar 10, 2025
fc91486
feat: add simple resource problem
tubadzin Mar 10, 2025
bab5da1
refactor: adapt problem description
tubadzin Mar 10, 2025
011be8d
refactor: rename lp to mip.
tubadzin Mar 10, 2025
9e8dbb3
feat: add converters
tubadzin Mar 10, 2025
8cd7955
feat: add qubo gams translation
tubadzin Apr 2, 2025
e0b2442
feat: add lp testcase
tubadzin Apr 2, 2025
757166b
feat: add qubo mip solver
tubadzin Apr 2, 2025
d29c947
feat: adapt gams parsing logic
Apr 9, 2025
cb0dec4
fix: undo hardcoded gams and python paths
tubadzin Apr 9, 2025
10fc65c
chore: remove unused scripts
tubadzin Apr 9, 2025
0d1d9ab
feat: adapt MIP solvers logic
tubadzin Apr 9, 2025
654724f
refactor: remove whitelines
tubadzin Apr 9, 2025
98a7d2f
fix: adapt input arguments
tubadzin Apr 9, 2025
a9ab795
feat: add testing for mip / lp solvers
tubadzin Apr 9, 2025
6f91ee3
fix: adapt output parsing logic in gams mip solver
tubadzin Apr 9, 2025
2d14e34
fix: repair input paths for qubo mip solver
Apr 9, 2025
33ae137
chore: remove unused files
Apr 9, 2025
539e8d0
chore: remove unused files
Apr 9, 2025
5ebd946
chore: adapt dependencies
Apr 9, 2025
0a435fd
feat: add cplex mip solver
Apr 9, 2025
a3bce39
chore: adapt properties for cplex solver
Apr 9, 2025
10e54a6
refactor: rename directory
Apr 9, 2025
a736af4
refactor: rename ortools occurances with cplex
Apr 9, 2025
1957b3c
refactor: add comments, expand explanations
Apr 9, 2025
71f5711
refactor: import checkstyle
Apr 9, 2025
4c53204
fix: adapt cplex logic to always write solution, not only in optimal …
Apr 9, 2025
d805bdd
refactor: line brakes
Apr 10, 2025
79e7652
refactor: add comment in gams mip solver
Apr 10, 2025
c54817e
chore: merge develop
tubadzin Apr 22, 2025
efb770f
fix: undo merge PythonProcessRunner change
tubadzin Apr 22, 2025
9f4b020
feat: add mip cplex solver
tubadzin Apr 22, 2025
e126e75
refactor: unused imports, naming schemes
May 6, 2025
beb374b
feat: split translation functionality from solve functionality
Jun 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions solvers/cplex/mip/mip.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import argparse
import cplex
import sys

parser = argparse.ArgumentParser(
description="Solve a MIP problem from an MPS file using IBM CPLEX."
)
parser.add_argument("input_file", help="Path to the input MPS file.")
parser.add_argument("output_file", help="Path to write the solution.")
args = parser.parse_args()

try:
cpx = cplex.Cplex()
cpx.read(args.input_file)
except cplex.exceptions.CplexError as exc:
print("Error reading the MPS file:", exc)
sys.exit(1)


try:
cpx.solve()
except cplex.exceptions.CplexError as exc:
print("Error during solve:", exc)
sys.exit(1)

status = cpx.solution.get_status()
with open(args.output_file, 'w') as out_file:
out_file.write("Solution status: {}\n".format(cpx.solution.get_status_string()))
out_file.write("Objective value = {}\n".format(cpx.solution.get_objective_value()))
var_names = cpx.variables.get_names()
var_values = cpx.solution.get_values()
for name, val in zip(var_names, var_values):
out_file.write("{:<15} = {}\n".format(name, val))
print("Solution written to", args.output_file)
1 change: 1 addition & 0 deletions solvers/cplex/mip/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cplex
22 changes: 22 additions & 0 deletions solvers/gams/mip/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2024 GAMS Software GmbH <support@gams.com>
Copyright (c) 2024 GAMS Development Corp. <support@gams.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading