# Setting PropertyValue for VertexWeight is not persistent

Bug introduced in 9.0.1 or earlier and fixed in 10.0

g = CompleteGraph[8, VertexSize -> Medium];

PropertyValue[{g, VertexList[g][[1]]}, VertexWeight] = 10;
PropertyValue[g, VertexWeight]

{10, 1, 1, 1, 1, 1, 1, 1}

PropertyValue[{g, VertexList[g][[2]]}, VertexWeight] = 10;
PropertyValue[g, VertexWeight]

{1, 10, 1, 1, 1, 1, 1, 1}

PropertyValue[{g, VertexList[g][[3]]}, VertexWeight] = 10;
PropertyValue[g, VertexWeight]

{1, 1, 10, 1, 1, 1, 1, 1}


How come that I see only the last result from PropertyValue? It applies only to VertexWeight property. When I set VertexStyle (like in docs), everything is fine: I can change the vertex color one by one.

• Beats me. A bug? – Sjoerd C. de Vries Sep 14 '13 at 20:56
• Interestingly, the very same examples work with VertexLabels instead of VertexWeight, so I guess VertexWeights always resets the weights for all vertices to 1 (the default value) when setting with PropertyValue[...] = val. Definitely unwanted behaviour, but sadly it is just one in a long list of annoyances with Graph... You should report it to Tech Support. – István Zachar Sep 14 '13 at 21:11
• Furthermore, not even SetProperty works here (as it worked here), in any form. – István Zachar Sep 14 '13 at 21:16
• I also note that the example in SetProperty's doc page (Scope/Basic Properties) PropertyValue[{%, 1}, VertexWeight] shows a result of \$Failed, indicating a problem at the time of generating the docs (though it now executes as intended). – Sjoerd C. de Vries Sep 14 '13 at 21:19
• Ok, I report this to the Support. Until then, all graph techniques that are dependent on weights are useless, I suppose. – Ilya Sorokin Sep 16 '13 at 8:32