I have a question about how to write the following model in CVX.
It is called “optimal configuration” or “graph realization” and It is the modified model
number (8) in the paper by Sun et al.
I do not really how to solve this model using CVX, especially the
constraints and how to write the vertices and edges?
You don’t need to explicitly write out the vertices and edges per se. For each edge, there will be a d_i_j, which is the problem input data. Model (8) has a norm(xi-xj) <= d_i_j constraint for each edge.
Note that (8) is not a convex optimization problem, as it is a maximization of a convex objective. Therefore, if you wish to use CVX, you will need to solve a different formulation, such as the primal, model (3), whose dual is equivalent to model (8), and which is convex and expressible as a DCP.
As to your modified model, you are solving a different and non-equivalent optimization problem, whose merits and “purpose” vs. the optimization problem in the paper are, I believe, outside the scope of discussion for this board. Nevertheless, I believe you meant to minimize y, not maximize y as you have written.
I think you’re out of luck on the first constraint (non-convex). As to the 2nd constraint, use norm instead of norm^2 (you can “absorb” the sqrt in the y and still minimize y) or “if you must square”, use square_pos(norm())