This function adds node weights to an edge-weighted graph. This is of interest in the study of weighted TSP, where the distance between two nodes is not based on the actual distance but additionally is influenced by the weight of the starting node or all nodes prior in the permutation. This is indeed of practical interest. E.g. consider a garbage collecting vehicle which requires the more gas per mile the heavier its load.

addNodeWeights(x, weights = NULL)

Arguments

x

[Network]
Network.

weights

[numeric(1)]
Numeric vector of weights.

See also