|
SOLUTIONS
|
COMBINATORICA パッケージ シンボル
SetEdgeWeights
SetEdgeWeights[g]
範囲
のランダムな実数の重みを,g の辺に割り当てる.
![]()
辺の重みを辺のリスト e の辺に割り当てる.
![]()
重みリスト w の重みを g の辺に割り当てる.
![]()
重みリスト w の重みを辺のリスト e の辺に割り当てる.
詳細詳細
を使うためには,まず Combinatorica パッケージをロードしなくてはならない.それにはNeeds["Combinatorica`"]を実行する必要がある.
はオプションWeightingFunctionとWeightRangeを取る.WeightingFunctionのデフォルト値はRandomであり,WeightRangeのデフォルト値は
である.- WeightingFunctionは値Random,RandomInteger,Euclidean,非負の n についてはLNorm[n]を取ることができる.また,各引数が{Integer, {Number, Number}}という形式の2つの引数を取る純関数でもよい.
- WeightRangeは整数範囲でも実数範囲でもよい.
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
