init_start {iGraphMatch}R Documentation

Initialization of the start matrix

Description

Initialize the start matrix for graph matching iteration.

Usage

init_start(start, nns, ns = 0, soft_seeds = NULL, seeds = NULL, ...)

Arguments

start

A matrix, character, or function. A nns-by-nns matrix, start method like "bari", "convex" or "rds", or a function to initialize the start matrix. If a function, it must have at least the arguments nns, ns, and softs_seeds.

nns

An integer. Number of non-seeds.

ns

An integer. Number of seeds.

soft_seeds

A vector, a matrix or a data frame indicating entries of the start matrix that will be initialized at 1 to indicate . See check_seeds.

seeds

A vector, a matrix or a data frame. Indicating hard seeds. These are used for "convex" start but otherwise are ignored.

...

Arguments passed to other start functions. See details in Values section.

Details

When start is a character, there are five options.

Value

init_start returns a nns-by-nns doubly stochastic matrix as the start matrix in the graph matching iteration. If conduct a soft seeding graph matching, returns a nns-by-nns doubly stochastic matrix with 1's corresponding to the soft seeds and values at the other places are derived by different start method.

Examples

ss <- matrix(c(5, 4, 4, 3), nrow = 2)
# initialize start matrix without soft seeds
init_start(start = "bari", nns = 5)
init_start(start = "rds", nns = 3)
init_start(start = "rds_perm_bari", nns = 5)
init_start(start = "rds_from_sim", nns = 3, sim = matrix(runif(9), 3))

# initialize start matrix with soft seeds
init_start(start = "bari", nns = 5, ns = 1, soft_seeds = ss)
init_start(start = "rds", nns = 5, soft_seeds = ss)
init_start(start = "rds_perm_bari", nns = 5, soft_seeds = ss)


# initialize start matrix for convex graph matching
cgnp_pair <- sample_correlated_gnp_pair(n = 10, corr =  0.3, p =  0.5)
g1 <- cgnp_pair$graph1
g2 <- cgnp_pair$graph2
seeds <- 1:10 <= 2
init_start(start = "convex", nns = 8, A = g1, B = g2, seeds = seeds)

# FW graph matching with incorrect seeds to start at convex start
init_start(start = "convex", nns = 8, ns = 2, soft_seeds = ss, A = g1, B = g2, seeds = seeds)



[Package iGraphMatch version 2.0.5 Index]