BUILT-IN WOLFRAM LANGUAGE SYMBOL

EdgeCost

EdgeCost
is an option and property for Graph and related functions that specifies an edge cost.

DetailsDetails

  • The following option settings can be used:
  • Automaticautomatically determine edge costs
    "prop"use the property as a cost
    {vivj->cij,}edge has cost etc.
    {c1,c2,}give all edge costs in the same order as used by EdgeList
    {pattern->c,}edge that matches the pattern has cost w
  • The wrapper Property[vivj,EdgeCost->c] can be used when creating graphs in functions such as Graph etc.
  • The cost can be any expression.
  • Edge costs can have special meanings for different graph computation functions.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

The EdgeCost option can be used to associate a cost with each edge in a graph:

In[1]:=
Click for copyable input
Out[1]=

The cost associated with edges affects results from functions such as FindMinimumCostFlow:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2012
(9.0)
Translate this page: