Skip to contents

Convert the input seeds data into data frame type with the first column being the indices of \(G_1\) and the second column being the corresponding indices of \(G_2\)

Usage

check_seeds(seeds, nv, logical = FALSE)

Arguments

seeds

A vector of integers or logicals, a matrix or a data frame. Input in the form of a vector of integers denotes the indices of seeds which are identical in both graphs. Input in the form of a vector of logicals indicate the location of seeds with TRUE and the indices of seeds are identical in both graphs. Input in the form of a matrix or a data frame, with the first column being the indices of \(G_1\) and the second column being the corresponding indices of \(G_2\).

nv

An integer. Number of total vertices.

logical

A logical. TRUE indicates to return seeds in a vector of logicals where TRUE indicates the corresponding vertex is a seed. FALSE indicates to return a data frame.

Value

returns a data frame with the first column being the corresponding indices of \(G_1\) and the second column being the corresponding indices of \(G_2\) or a vector of logicals where TRUE indicates the corresponding vertex is a seed.

Examples

#input is a vector of logicals
check_seeds(1:10 <= 3, nv = 10)
#> $seeds
#>   A B
#> 1 1 1
#> 2 2 2
#> 3 3 3
#> 
#> $nonseeds
#>    A  B
#> 1  4  4
#> 2  5  5
#> 3  6  6
#> 4  7  7
#> 5  8  8
#> 6  9  9
#> 7 10 10
#> 

#input is a vector of integers
check_seeds(c(1,4,2,7,3), nv = 10)
#> $seeds
#>   A B
#> 1 1 1
#> 2 4 4
#> 3 2 2
#> 4 7 7
#> 5 3 3
#> 
#> $nonseeds
#>    A  B
#> 1  5  5
#> 2  6  6
#> 3  8  8
#> 4  9  9
#> 5 10 10
#> 

#input is a matrix
check_seeds(matrix(1:4,2), nv = 10)
#> $seeds
#>   A B
#> 1 1 3
#> 2 2 4
#> 
#> $nonseeds
#>    A  B
#> 1  3  1
#> 2  4  2
#> 3  5  5
#> 4  6  6
#> 5  7  7
#> 6  8  8
#> 7  9  9
#> 8 10 10
#> 

#input is a data frame
check_seeds(as.data.frame(matrix(1:4,2)), nv = 10)
#> $seeds
#>   A B
#> 1 1 3
#> 2 2 4
#> 
#> $nonseeds
#>    A  B
#> 1  3  1
#> 2  4  2
#> 3  5  5
#> 4  6  6
#> 5  7  7
#> 6  8  8
#> 7  9  9
#> 8 10 10
#>