addNodeWeights: Add node weights.

View source: R/addNodeWeights.R

addNodeWeightsR Documentation

Add node weights.

Description

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.

Usage

addNodeWeights(x, weights = NULL)

Arguments

x

[Network]
Network.

weights

[numeric(1)]
Numeric vector of weights.

See Also

generateRandomNetwork, generateClusteredNetwork, generateGridNetwork


jakobbossek/netgen documentation built on Feb. 11, 2024, 1:02 a.m.