# Assign vertex label as vertex value without changing edgeWeight [closed]

I am new to Mathematica. I have drawn a node graph, which has approximate 600 vertices and specific edge weight (as shown below). There is a vertex label in each vertex. I want to assign vertex label as a vertex value. I can do it by this.

rplcmntRule = VertexLabels /. Options[g]
newVertices = VertexList[g] /. rplcmntRule;
newEdges = EdgeList[g] /. rplcmntRule
g = Graph[newEdges, VertexLabels -> Placed["Name", {1/2, 1/2}]]


But this method also changes the edge weight. I want to change the vertex only, without changing the edge weight.

## closed as off-topic by Szabolcs, m_goldberg, LCarvalho, MarcoB, Alexey PopkovOct 22 '17 at 11:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Szabolcs, m_goldberg, LCarvalho, MarcoB, Alexey Popkov
If this question can be reworded to fit the rules in the help center, please edit the question.

You can rename vertices using the VertexReplace function. It will preserve edge weights.
• @Salahuddin With a clearer mind in the morning, I think I see what you mean. Those are not edge weights. They are edge labels. They cannot be used in computation. The EdgeWeight property does get correctly preserved (unlike the EdgeLabels property). It would help if you have a complete and correct example in your next question (see sscce.org) – Szabolcs Aug 16 '17 at 7:03