def _add_constraints(self, relation):
expression = relation.expression<EOL>pairs = []<EOL>for value_set in expression.value_sets():<EOL><INDENT>ind, val = zip(*((self._variables[variable], float(value))<EOL>for variable, value in value_set))<EOL>pairs.append(cp.SparsePair(ind=ind, val=val))<EOL><DEDENT>names = [next(self._constr_names) for _ in pairs]<EOL>sense = self.CONSTR_SENSE_MAP[relation.sense]<EOL>self._cp.linear_constraints.add(<EOL>names=names, lin_expr=pairs,<EOL>senses=tuple(repeat(sense, len(pairs))),<EOL>rhs=tuple(repeat(float(-expression.offset), len(pairs))))<EOL>return names<EOL>
Add the given relation as one or more constraints

        Return a list of the names of the constraints added.