SetVertexWeights[g]
assigns random real weights in the range to vertices in g.
SetVertexWeights[g,w]
assigns the weights in the weight list w to the vertices of g.
SetVertexWeights[g,vs,w]
assigns the weights in the weight list w to the vertices in the vertex list vs.


SetVertexWeights
SetVertexWeights[g]
assigns random real weights in the range to vertices in g.
SetVertexWeights[g,w]
assigns the weights in the weight list w to the vertices of g.
SetVertexWeights[g,vs,w]
assigns the weights in the weight list w to the vertices in the vertex list vs.
Details and Options
- SetVertexWeights functionality is now available in the built-in Wolfram Language function VertexWeight.
- To use SetVertexWeights, you first need to load the Combinatorica Package using Needs["Combinatorica`"].
- SetVertexWeights accepts options WeightingFunction and WeightRange. The default value for WeightingFunction is Random and the default value for WeightRange is {0,1}.
- WeightingFunction can take values Random, RandomInteger, or any pure function that takes two arguments: an integer as the first argument and a pair {number,number} as the second argument.
- WeightRange can be an integer range or a real range.
See Also
Tech Notes
Related Guides
-
▪
- Displaying Graphs ▪
- Graph Construction and Representations ▪
- Graphs & Networks ▪
- Graph Visualization ▪
- Computation on Graphs ▪
- Graph Construction & Representation ▪
- Graphs and Matrices ▪
- Graph Properties & Measurements ▪
- Graph Operations and Modifications ▪
- Statistical Analysis ▪
- Social Network Analysis ▪
- Graph Properties ▪
- Mathematical Data Formats ▪
- Discrete Mathematics
Text
Wolfram Research (2012), SetVertexWeights, Wolfram Language function, https://reference.wolfram.com/language/Combinatorica/ref/SetVertexWeights.html.
CMS
Wolfram Language. 2012. "SetVertexWeights." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/Combinatorica/ref/SetVertexWeights.html.
APA
Wolfram Language. (2012). SetVertexWeights. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/Combinatorica/ref/SetVertexWeights.html
BibTeX
@misc{reference.wolfram_2025_setvertexweights, author="Wolfram Research", title="{SetVertexWeights}", year="2012", howpublished="\url{https://reference.wolfram.com/language/Combinatorica/ref/SetVertexWeights.html}", note=[Accessed: 09-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_setvertexweights, organization={Wolfram Research}, title={SetVertexWeights}, year={2012}, url={https://reference.wolfram.com/language/Combinatorica/ref/SetVertexWeights.html}, note=[Accessed: 09-August-2025]}