v <- c(0, 0, 0, 2, 1, 4, 6)
a <- c(3, 1, 2) # an allocation for v
b <- c(2, 2, 2) # egalitarian solution for v
belong2corecheck(v = v, binary = TRUE, x = a, instance = TRUE)
belong2corecheck(v = v, binary = FALSE, x = b, instance = TRUE)
# What if the game is a cost game?
cost.v <- c(2,2,2,3,4,4,5) # cost game
cost.x <- c(1,2,2) # core allocation of cost.v
belong2corecheck(v = -cost.v, x = -cost.x)
Run the code above in your browser using DataLab