Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Representation and Properties > EdgeWeight >
Mathematica > Visualization and Graphics > Graphs & Networks > Graph Representation and Properties > EdgeWeight >

EdgeWeight

EdgeWeight
is an option and property for Graph and related functions that specifies an edge weight.
  • The following option settings can be used:
{w1,w2,...}give all edge weights in the same order as used by EdgeList
  • 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 can have other special meanings for different graph computation functions.
Set a weight for all edges:
Use any numeric expression as a weight:
Set a weight for all edges:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]//MatrixForm=
 
Use any numeric expression as a weight:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]//MatrixForm=
New in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF