listmat: From cost matrix to list of feasible assignments.

View source: R/listmat.R

listmatR Documentation

From cost matrix to list of feasible assignments.

Description

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

Usage

listmat(x)

Arguments

x

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

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.

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.

Author(s)

Massimo Cannas <massimo.cannas@unica.it>

See Also

See matlist, the reverse function.

Examples

# 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)

OSDR documentation built on March 18, 2022, 7:33 p.m.