def max_min_l1(self, reaction, weights={}):
self.maximize(reaction)<EOL>if isinstance(reaction, dict):<EOL><INDENT>reactions = list(reaction)<EOL><DEDENT>else:<EOL><INDENT>reactions = [reaction]<EOL><DEDENT>fluxes = {r: self.get_flux(r) for r in reactions}<EOL>for r in reactions:<EOL><INDENT>flux_var = self.get_flux_var(r)<EOL>c, = self._prob.add_linear_constraints(flux_var == fluxes[r])<EOL>self._temp_constr.append(c)<EOL><DEDENT>self.minimize_l1(weights)<EOL>
Maximize flux of reaction then minimize the L1 norm.

        During minimization the given reaction will be fixed at the maximum
        obtained from the first solution. If reaction is a dictionary object,
        each entry is interpreted as a weight on the objective for that
        reaction (non-existent reaction will have zero weight).