'Returns the graph implementation of the object.
Change the ids of all the opt_vars.
Returns
A tuple of (affine expression, [constraints]).'

def canonicalize(self):

    (obj, constrs) = self._prob.objective.args[0].canonical_form
    for cons in self._prob.constraints:
        constrs += cons.canonical_form[1]
    return (obj, constrs)
