$$C_{ij} = \|x_i - y_j\|_p$$
Peyre & Cuturi (2019), Sec. 2.4. p = Inf gives the sup norm.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Otcostlp(V, V)
#> $estimate
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 0 1 2 3 4 5 6 7
#> [2,] 1 0 1 2 3 4 5 6
#> [3,] 2 1 0 1 2 3 4 5
#> [4,] 3 2 1 0 1 2 3 4
#> [5,] 4 3 2 1 0 1 2 3
#> [6,] 5 4 3 2 1 0 1 2
#> [7,] 6 5 4 3 2 1 0 1
#> [8,] 7 6 5 4 3 2 1 0
#>
#> $p
#> [1] 2
#>
#> $nrow
#> [1] 8
#>
#> $ncol
#> [1] 8
#>
#> $total
#> [1] 168
#>
#> $method
#> [1] "l_p ground cost -- Peyre & Cuturi (2019) Sec. 2.4"
#>
