def checkBoundsExplicit(solution, lb, ub):
    """ check if flux distribution 'solution' violates any of the given lower
        and upper flux bounds

    Keyword arguments:

    solution -- flux distribution (MetabolicFlux object)
    lb, ub   -- dicts {reaction : bound} of lower and upper bounds

    Returns:  lbViolations, ubViolations - {reaction : flux, bound} dicts
    """
    lbViolations, ubViolations = {}, {}
    for rea in solution:
        flux = solution[rea]
        if rea in lb:
            if flux < lb[rea]:
                lbViolations[rea] = flux, lb[rea]
        if rea in ub:
            if flux > ub[rea]:
                ubViolations[rea] = flux, ub[rea]
    return lbViolations, ubViolations
