Learn R Programming

netgen (version 1.3.2)

addNodeWeights: 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