# Problems with PropertyValue when Graph's vertices are Lists

I create a Graph which vertices are lists (points in n-dimensional space)

v1 = {{1, 2} -> {3, 4}, {5, 6} -> {7, 8}};
g1 = Graph[v1];
PropertyValue[{g1, VertexList[g1][[1]]}, VertexWeight] = 10


and I get a message error:

Set::write: Tag PropertyValue in PropertyValue[...] is protected


Now, if I do

v2 = {1 -> 2, 3 -> 4};
g2 = Graph[v2];
PropertyValue[{g2, VertexList[g2][[1]]}, VertexWeight] = 10


everything is fine.

g1 and g2 are structurally indentical, the difference is only in vertices type: list(g1) and scalar(g2).

What's the problem here?

-
I think it is better not to use lists as vertices as it can introduce all sorts of similar interferences. I would advice you to use another wrapper instead of List, e.g. Graph[{f[1,2]->f[3,4], ...}]. –  István Zachar Sep 14 '13 at 7:23

## 1 Answer

It works if you specify weights in the following way:

g = Graph[{{1, 2} -> {3, 4}, {5, 6} -> {7, 8}}];
g = SetProperty[g, VertexWeight -> {{1, 2} -> 10}];
PropertyValue[g, VertexWeight]

{10, 1, 1, 1}

-
Ok, so SetProperty works here. Thanks. –  Ilya Sorokin Sep 14 '13 at 7:53