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

Property

Property
associates the property with item.
  • Properties are used to store and manipulate pairs for specific named items within an object such as Graph.
  • Property acts as an inert wrapper around items.
  • The items available for Graph objects include vertices and edges.
Specify a vertex property:
Specify an edge property:
Specify a vertex property:
In[1]:=
Click for copyable input
Out[1]=
 
Specify an edge property:
In[1]:=
Click for copyable input
Out[1]=
Set properties for vertices:
And edges:
Property can be used to set several properties of vertices:
And edges:
Some properties have equivalent wrappers, including Labeled:
And Style:
Standard vertex properties include VertexStyle:
Non-visual properties include VertexWeight:
Specify a custom property:
Standard edge properties include EdgeStyle:
Non-visual properties include EdgeWeight:
Specify a custom property:
Use Table to set similar properties for many items:
Use PropertyValue to extract values:
For undefined properties, the value $Failed is returned:
Use PropertyValue to set properties in a graph:
The original graph has changed:
Use PropertyValue to unset properties in a graph:
The original graph has changed:
Use PropertyList to test for the presence of a property:
Generate a list of vertex label rules:
Use SetProperty to set a property without changing the original:
The original graph is unchanged:
Use RemoveProperty to remove a property without changing the original:
The original graph is unchanged:
New in 8