This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

VertexWeight

VertexWeight
is an option and property for Graph and related functions that specifies a vertex weight.
  • The following option settings can be used:
{w1,w2,...}give all vertex weights in the same order as used by VertexList
  • The wrapper Property can be used when creating graphs in functions such as Graph etc.
  • The weight can be any expression.
  • The weight can be interpreted as cost or capacity, or have other special meanings for different graph computation functions.
Set the weight for all vertices:
Use any expression as a weight:
Set the weight for all vertices:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Use any expression as a weight:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
New in 8