'Reduces the atom to an affine expression and list of constraints.
minimize n^2 + 2M|s|
subject to s + n = x
Parameters
arg_objs : list
LinExpr for each argument.
size : tuple
The size of the resulting expression.
data :
Additional data required by the atom.
Returns
tuple
(LinOp for objective, list of constraints)'

@staticmethod
def graph_implementation(arg_objs, size, data=None):

    M = data[0]
    x = arg_objs[0]
    n = lu.create_var(size)
    s = lu.create_var(size)
    two = lu.create_const(2, (1, 1))
    if isinstance(M, Parameter):
        M = lu.create_param(M, (1, 1))
    else:
        M = lu.create_const(M.value, (1, 1))
    (n2, constr_sq) = power.graph_implementation([n], size, (2, (Fraction(1, 2), Fraction(1, 2))))
    (abs_s, constr_abs) = abs.graph_implementation([s], size)
    M_abs_s = lu.mul_expr(M, abs_s, size)
    obj = lu.sum_expr([n2, lu.mul_expr(two, M_abs_s, size)])
    constraints = (constr_sq + constr_abs)
    constraints.append(lu.create_eq(x, lu.sum_expr([n, s])))
    return (obj, constraints)
