Replies: 5 comments 17 replies
-
The names issue requires coding in C corresponding to vectors of strings in C++. I'll have a go, but may need help as I'm not a C programmer (particularly when it comes to I can add a |
Beta Was this translation helpful? Give feedback.
-
I've started trying to write something to get and pass names in C++ - without using I can just about understand the difference between In C
|
Beta Was this translation helpful? Give feedback.
-
I've added I've even managed to test them in #1168 will merged this work into Do these work for you @rschwarz ? |
Beta Was this translation helpful? Give feedback.
-
I did a search and didn't find anything related to col/row names other than this discussion and another search didn't bring up This is a snippet of a Python function using pywraplp with the CBC backend where I benefit from not having to fuss with tracking and passing around names or indices which allows for the model solving to be extracted from the building logic. def subset_selection(items, item_reqs, weights, state_1_values, state_2_values,
state_1_sum_values_lb, state_2_sum_values_lb):
solver = subset_solver(items, item_reqs, weights, state_1_values, state_2_values)
state_1_constraint = solver.LookupConstraint("state_1_lb")
state_2_constraint = solver.LookupConstraint("state_2_lb")
state_1_constraint.SetBounds(state_1_sum_values_lb, solver.infinity())
state_2_constraint.SetBounds(state_2_sum_values_lb, solver.infinity())
result_status = solver.Solve()
if result_status == pywraplp.Solver.OPTIMAL:
return extract_solution(solver, items, weights, state_1_values, state_2_values)
return (None, None, None, None, None) the def subset_selection_par(items, item_reqs, weights, state_1_values, state_2_values,
state_values_sum_lb_pairs):
solutions = []
solver = subset_solver(items, item_reqs, weights, state_1_values, state_2_values)
state_1_constraint = solver.LookupConstraint("state_1_lb")
state_2_constraint = solver.LookupConstraint("state_2_lb")
for state_1_sum_values_lb, state_2_sum_values_lb in state_values_sum_lb_pairs:
state_1_constraint.SetBounds(state_1_sum_values_lb, solver.infinity())
state_2_constraint.SetBounds(state_2_sum_values_lb, solver.infinity())
result_status = solver.Solve()
if result_status != pywraplp.Solver.OPTIMAL:
continue
solutions.append(extract_solution(solver, items, weights, state_1_values, state_2_values))
return solutions They are each used to run the model over a variety of sets of data where the solutions for a variety of bound params are used for each dataset. This is something readily solvable on the user's end with a dictionary/hashmap of Name: Col but then that has to be built and passed around. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
While working on a wrapper for HiGHS, I felt like missing out on some functionality that is supported in principle, but not currently exposed through the C API.
For instance:
getColIntegrality
. Even Highs_getColsByRange etc fetch the coefficients, bounds and objective cost, but not the variable type.I also needed to query specific attributes of rows and columns (eg just upper bound) which is a bit awkward because when using, eg
Highs_getColsByRange
, a handful for arrays need be allocated, but this is just a minor inconvenience.Beta Was this translation helpful? Give feedback.
All reactions