3

The document of the command VertexWeight claimed that: enter image description here

However, I found that it throw wrong result when I use a list as member of VertexWeight, as can be seen below: enter image description here

PokerN
  • 71
  • 4
  • The trick in Carl's answer in the linked q/a also works here: g=Block[{Identity}, Graph[{1 <-> 2, 2 <-> 3, 3 <-> 1}, VertexWeight -> Identity /@ {RandomImage[1,{5,5}, ImageSize->40], RandomImage[1,{5,5}, ImageSize->50, ColorSpace->"RGB"] , {1, 1}}]] – kglr May 26 '18 at 13:34
  • If you find a bug, please report it to Wolfram directly. That's the only way to get them to fix it. Have you done it already? – Szabolcs May 27 '18 at 07:24
  • Thank you very much! The solution you mentioned above is a good choice, but not perfect. If I use g=Block[...], I can not change the property of g, for example, PropertyValue[{g, 3}, VertexWeight] = {2, 4}. So, I took a compromise solution: g=Graph[{1 <-> 2, 2 <-> 3, 3 <-> 1}, VertexWeight ->{ PE[x1,y1] , PE[x2,y2] , PE[x3,y3] }. When I need use these values of VertexWeight to compute, I can use rule (->) to do everything as usual, and I can also change it. – PokerN May 27 '18 at 14:53

0 Answers0