def flux_minimization(model, fixed, solver, weights={}):
fba = FluxBalanceProblem(model, solver)<EOL>for reaction_id, value in iteritems(fixed):<EOL><INDENT>flux = fba.get_flux_var(reaction_id)<EOL>fba.prob.add_linear_constraints(flux >= value)<EOL><DEDENT>fba.minimize_l1()<EOL>return ((reaction_id, fba.get_flux(reaction_id))<EOL>for reaction_id in model.reactions)<EOL>
Minimize flux of all reactions while keeping certain fluxes fixed.

    The fixed reactions are given in a dictionary as reaction id
    to value mapping. The weighted L1-norm of the fluxes is minimized.

    Args:
        model: MetabolicModel to solve.
        fixed: dict of additional lower bounds on reaction fluxes.
        solver: LP solver instance to use.
        weights: dict of weights on the L1-norm terms.

    Returns:
        An iterator of reaction ID and reaction flux pairs.