Replies: 1 comment 2 replies
-
Could you try importing sum from optlang.symbolics, that might be faster. It's quite likely optlang being slow, as it tries to simplify the expression with each added term. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to have the objective function of my model (iJO1366 - contains ~2600 reactions) to be minimize the sum of all the fluxes and the sum of 37 slack variables (or artificial fluxes) that are weighted.
so the v's are all the fluxes, beta is a scalar and the alpha's are the slack variables/artificial fluxes.
When I try to set this as the objective function it takes a very long time to set up (I gave up after 15 minutes). Is there no faster way to do this than what i'm doing now which is:
model.objective = model.problem.Objective(
sum(r.flux_expression for r in real_rxns) + beta * sum(r.flux_expression for r in alphas_rxns),
direction='min')
Thanks to anyone who helps!
Beta Was this translation helpful? Give feedback.
All reactions