'Computes the graph implementation of the problem.
Returns
tuple
(affine objective,
constraints dict)'

def canonicalize(self):

    canon_constr = []
    (obj, constr) = self.objective.canonical_form
    canon_constr += constr
    for constr in self.constraints:
        canon_constr += constr.canonical_form[1]
    return (obj, canon_constr)
