In cell costs[1,3] I need to use NULL or NA. Because in the problem there is a constraint that says that row 1 should not give supplies to column 3. I tried to use 0 but i'm not getting the corrrect answer. (Is not possible to use NA, NULL ON lp.transport)
# Set up cost matrix
#
costs <- matrix (0, 3, 3); costs[1,1] <- costs[3,3] <- 120
costs[1,2]<-180
costs[2,1]<-300; costs[2,2]<-100; costs[2,3] <- 80
costs[3,1]<-200; costs[3,2]<-250
#
# Set up constraint signs and right-hand sides.
#
row.signs <- rep ("<=", 3)
row.rhs <- c(6,5,8)
col.signs <- rep ("=", 3)
col.rhs <- c(4,8,7)
#
# Run
#
lp.transport (costs, "min", row.signs, row.rhs, col.signs, col.rhs)
lp.transport (costs, "min", row.signs, row.rhs, col.signs, col.rhs)$solution