The functions SetProperty and PropertyValue can only set a single property of a single vertex, as far as I know. How do I set a property for multiple vertices simultaneously?
In the documentation, they recommend using Do to set multiple properties, but I've heard that Do is not the most efficient way to do things in Mathematica. Are there any alternatives?
EDIT : The only approach seems to make several calls to SetProperty or PropertyValue (which is faster), one call for each distinct vertex property I want to set. From the answers so far it seems that there is no Mathematica equivalent to SetProperty or PropertyValue that sets several properties of distinct vertices at once. But I'd still hope that something could be done directly on the Graph object, bypassing SetProperty and PropertyValue.





PropertyValueis new in version 8, but when mma 9 comes along this tag will become redundant... – Ajasja May 20 '12 at 20:27Combinatoricapackage and theGraphPlotet al, which have been there at least since version 6; the other is theGraphobject, which is new to version 8. The tag graphs-and-networks alone would not make this distinction. – becko May 20 '12 at 23:32