bipartiteMatch: Bipartite graph matching

Description Usage Arguments Details Value Examples

View source: R/RcppExports.R

Description

Hungarian algorithm for matching samples in a bipartite graph from a distance ("cost") matrix

Usage

1
bipartiteMatch(costMatrix)

Arguments

costMatrix

A distance matrix giving the cost of each possible pairing

Details

This algorithm was cloned from RcppHungarian, an Rcpp wrapper for the original C implementation by Cong Ma (2016).

Value

n x 2 matrix of pairings

List of components "cost" and "parings", with pairings given as an n x 2 matrix

Examples

1
2
3
4
5
costMatrix <- rbind(c(1, 2, 0), 
              c(2, 0, 1), 
              c(1, 4, 19))
matched <- bipartiteMatch(costMatrix)
matched

zdebruine/LSMF documentation built on Jan. 1, 2021, 1:50 p.m.