Constructs one n x n matrix per objective so that the weight of any
edge (i, j) can be queried in O(1) via standard matrix indexing.
Arguments
- instance
data.framereturned bygenerate_instanceor one with columnsfrom,to,weight_1,weight_2(and optionallyweight_3).- n
Integer. Number of nodes.
- num_obj
Integer. Number of objectives (2 or 3).
Examples
inst <- generate_instance(10, 2, seed = 1)
L <- build_weight_lookup(inst, 10, 2)
L[[1]][1, 2]
#> [1] 33.89578