Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getOptimalPointMatching

Computes optimal point assignment for two sets of points of equal size.


Description

Internally it handles the points and the possible matchings as a bi-partite graphs and finds an optimal matching due to euclidean distance by an efficient linear programming solver.

Usage

getOptimalPointMatching(x, y, method = "lp", full.output = FALSE)

Arguments

x

[Network | matrix]
First network or matrix of coordinates of the first point set.

y

[Network | matrix]
Second network or matrix of coordinates of the second point set.

method

[character(1)]
Method used to solve the assignment problem. There are currently two methods available:

lp

Solves the problem be means of linear programming with the lpSolve package to optimality. This is the default.

push_relabel

The assignment problem can be formulated as a matching problem on bipartite graphs. This method makes use of the push-relabel algorithm from the igraph. Solves to optimality.

random

Random point matching. Just for comparisson.

greedy

Greedy point matching, i.e., iterativeely assign two unmatched points with minimal euclidean distance.

full.output

[logical(1)]
Should optimization process information, e.g., the weight of the best matching, be returned? Default is FALSE.

Value

[matrix | list] Either a matrix where each row consists of the indizes of the pairwise assigned points. If full.output = TRUE a list is returned with the assignment matrix “pm”, the method “method” and the optimal weight “opt.weight”.

See Also


netgen

Network Generator for Combinatorial Graph Problems

v1.3.2
BSD_3_clause + file LICENSE
Authors
Jakob Bossek [aut, cre]
Initial release
2020-01-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.