The documentation for VertexWeight clearly states:
The weight wi can be any expression.
But I cannot seem to set list-valued vertex weights in my graph:
Graph[
{"A", "B", "C"},
Map[Apply[UndirectedEdge], {{"A", "B"}, {"A", "C"}}],
VertexWeight -> {1, 2, 3}
] // GraphQ
(* True *)
Graph[
{"A", "B", "C"},
Map[Apply[UndirectedEdge], {{"A", "B"}, {"A", "C"}}],
VertexWeight -> {{1, 2}, {2, 3}, {3, 4}}
] // GraphQ
(* False *)
Is this a bug, or do I have a syntax error somewhere? (I am using Mathematica 13.0 on Windows 11 Pro.)
g = Graph[{"A", "B", "C"}, {"A" <-> "B", "A" <-> "C"}, AnnotationRules -> {"A" -> {"vertwt" -> {1, 2}}, "B" -> {"vertwt" -> {3, 4}}, "C" -> {"vertwt" -> {4, 5}}}]and access them via something likeAnnotationValue[{g, "A"}, "vertwt"]– Jason B. Jan 10 '22 at 18:59VertexWeightis special, and seems to be optimized for storing numerical values. It can be accessed much faster than other properties. Unfortunately, these quirks of the property system are not documented. https://mathematica.stackexchange.com/q/118196/12 – Szabolcs Jan 11 '22 at 14:16