PRODUCTS
Products Overview
Mathematica
Mathematica for Students
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Wolfram
SystemModeler
Wolfram
Finance Platform
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
Merchandise
SUPPORT
Support Overview
Knowledge Base
Learning Center
Community & Forums
Training
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News & Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
New to
Mathematica
?
Find your learning path
»
Mathematica
>
Mathematics and Algorithms
>
Graphs & Networks
>
Graph Programming
>
PropertyValue
>
Mathematica
>
Visualization and Graphics
>
Graphs & Networks
>
Graph Programming
>
PropertyValue
>
Mathematica
>
Mathematics and Algorithms
>
Graphs & Networks
>
Graph Representation and Properties
>
Graph Programming
>
PropertyValue
>
BUILT-IN MATHEMATICA SYMBOL
SetProperty
PropertyList
RemoveProperty
Property
Graph
CurrentValue
See Also »
|
Graph Programming
Graph Representation and Properties
Graphs & Networks
New in 8.0: Alphabetical Listing
More About »
PropertyValue
PropertyValue
gives the property value associated with
name
for
item
in
obj
.
MORE INFORMATION
Properties are used to store and manipulate
pairs for specific named items within an object such as
Graph
.
PropertyValue
returns
$Failed
whenever there is no property value available for
name
.
PropertyValue
[{
obj
,
item
},
name
]=
val
can be used to modify the property value.
The items available for
Graph
objects include vertices and edges.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Generate a complete graph with properties:
Retrieve the property value associated with property name:
Change the property value:
Unset the property value:
Generate a complete graph with properties:
In[1]:=
Out[1]=
Retrieve the property value associated with property name:
In[2]:=
Out[2]=
Change the property value:
In[3]:=
In[4]:=
Out[4]=
Unset the property value:
In[5]:=
In[6]:=
Out[6]=
Scope
(8)
Set a property value for vertex 1:
Retrieve the property value for vertex 1:
Set a property value for the edge
:
Retrieve the property value for the edge
:
Unset properties for vertices:
And edges:
PropertyValue
returns
$Failed
for undefined properties:
Standard vertex properties include
VertexStyle
:
VertexLabels
:
VertexSize
:
VertexShape
:
VertexShapeFunction
:
VertexCoordinates
:
Non-visual properties include
VertexWeight
:
Set a custom property:
Standard edge properties include
EdgeStyle
:
EdgeLabels
:
Non-visual properties include
EdgeWeight
:
Set a custom property:
Applications
(5)
Use
Do
to set several property values:
Or different property values for different items:
Use
Table
to build a list of property values:
Create a weighted graph:
Set edge weights:
Compute weight scale:
Set the edge thickness to reflect the edge weight:
Highlight a path and mark the beginning point and endpoint:
Select vertices along a path:
Highlight by setting edge style along the path and vertex labels for start point and endpoint:
Dynamically highlight the edges in the order given by
EdgeList
:
Do five updates a second:
Dynamically visualize breadth-first search:
Properties & Relations
(4)
Use
Property
as a wrapper to specify properties in functions such as
Graph
:
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:
Possible Issues
(2)
PropertyValue
returns
$Failed
for undefined properties:
Use
PropertyList
to test for the presence of a property:
PropertyValue
may return
$Failed
even when a property value exists:
Use
PropertyList
to check for actual property values:
SEE ALSO
SetProperty
PropertyList
RemoveProperty
Property
Graph
CurrentValue
MORE ABOUT
Graph Programming
Graph Representation and Properties
Graphs & Networks
New in 8.0: Alphabetical Listing
New in 8