nonbimatch {nbpMatching}R Documentation

Nonbipartite Matching

Description

The nonbinmatch function creates the set of pairwise matches that minimizes the sum of distances between the pairs.

Usage

nonbimatch(mdm, precision = 6, ...)

Arguments

mdm A distancematrix object. See the distancematrix function.
precision The largest value in the matrix will have at most this many digits. The default value is six.
... Additional arguments, these are not used.

Details

The nonbinmatch function calls the Fortran code (Derigs) and set of pairwise matches that minimizes the sum of distances between the pairs.

Value

matches data.frame containing matches
halves data.frame containing each match
total sum of the distances across all pairs
mean mean distance for each pair

Author(s)

Cole Beck

See Also

distancematrix

Examples

plainmatrix<-as.matrix(dist(sample(1:25, 8, replace=TRUE)))
diag(plainmatrix) <- 99999  # setting diagonal to an infinite distance for
                            # pedagogical reasons (the diagonal may be left
                            # as zero)
mdm<-distancematrix(plainmatrix)
res<-nonbimatch(mdm)

[Package nbpMatching version 1.0 Index]