Learn R Programming

OSDR (version 1.1)

listmat: From cost matrix to the list of feasible assignments.

Description

Transforms the cost matrix of the assignment problem in the list of suitable applicants for each job.

Usage

listmat(x)

Arguments

x

A cost matrix where entry \((i,j)\) gives the cost of assigning job i to applicant j.

Value

A list of suitable applicants. The \(i^{th}\) element of the list contains the suitable applicants for job i. These are all applicants with finite assignment cost. Note that if the cost matrix contains finite non zero values there is a loss of information in the transformation.

Details

In statistical matching problems the input is usually the cost matrix while in assignment problems is the list of assignable elements. Functions matlist and listmat go back and forth these two representations of the input.

See Also

See matlist, the reverse function.

Examples

Run this code
# NOT RUN {
# a list of feasible applicants for five jobs	
M1<-c("A","B","C")
M2<-c("A","C")
M3<-c("B")
M4<-c("A","C")
M5<-c("A","D")
M  <-list(M1,M2,M3,M4,M5)
M

# list --> cost matrix
m <- listmat(M)

# cost matrix --> list
l <- matlist(m)
# }

Run the code above in your browser using DataLab