EdgeCost

EdgeCost

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

Details

  • The following option settings can be used:
  • Automaticautomatically determine edge costs
    "prop"use the annotation "prop" as a cost
    {vivj->cij,}edge v_(i)v_(j) has cost c_(ij) 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 Annotation[vivj,EdgeCost->c] can be used when creating graphs in functions such as Graph etc.
  • The cost c_(i) can be any expression.
  • Edge costs can have special meanings for different graph computation functions.

Examples

Basic Examples  (1)

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

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

Wolfram Research (2012), EdgeCost, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeCost.html.

Text

Wolfram Research (2012), EdgeCost, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeCost.html.

CMS

Wolfram Language. 2012. "EdgeCost." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/EdgeCost.html.

APA

Wolfram Language. (2012). EdgeCost. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeCost.html

BibTeX

@misc{reference.wolfram_2023_edgecost, author="Wolfram Research", title="{EdgeCost}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeCost.html}", note=[Accessed: 18-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_edgecost, organization={Wolfram Research}, title={EdgeCost}, year={2012}, url={https://reference.wolfram.com/language/ref/EdgeCost.html}, note=[Accessed: 18-March-2024 ]}