north_west_corner: North-west-corner Rule

north_west_cornerR Documentation

North-west-corner Rule

Description

Calculate the transport plan obtained by the north-west-corner rule.

Usage

north_west_corner(wx, wy, threshold = 1e-15)

Arguments

wx

first weight vector.

wy

second weight vector.

threshold

small value that indicates when a value is considered to be zero.

Value

a matrix representing the transport plan obtained by the north-west-corner rule.

Examples

set.seed(1)
wx <- rep(1/5, 5)
wy <- runif(6)
wy <- wy / sum(wy)
north_west_corner(wx, wy)

gridOT documentation built on Oct. 19, 2022, 1:06 a.m.