Skip to contents

Summary methods for graphMatch objects

Usage

# S4 method for graphMatch
summary(object, A = NULL, B = NULL, true_label = NULL, directed = NULL)

Arguments

object

graphMatch object

A

igraph or matrix-like object

B

igraph or matrix-like object

true_label

the true correspondence (if available)

directed

whether to treat the graphs as directed (TRUE) or not directed (FALSE) default is NULL which will treat the graphs as directed if either adjacency matrix is not symmetric.

Value

summary returns the graph matching formula, and a summary of graph matching results including the number of matches, the number of correct matches (if the true correspondence is available), and common edges, missing edges, extra edges, common non-edges and the objective function value.

Examples

set.seed(123)
graphs <- sample_correlated_gnp_pair(20, .9, .3)
A <- graphs$graph1
B <- graphs$graph2
match <- gm(A, B, 1:4, method = "percolation")

summary(match, A, B)
#> Call: gm(A = A, B = B, seeds = 1:4, method = "percolation")
#> 
#> # Matches: 15, # Seeds:  4, # Vertices:  20, 20
#>                  
#>   common_edges 55
#>  missing_edges  2
#>    extra_edges  6
#>          fnorm  4
summary(match, A, B, true_label = 1:20) # also output the number of correct matches
#> Call: gm(A = A, B = B, seeds = 1:4, method = "percolation")
#> 
#> # Matches: 15
#> # True Matches:  15, # Seeds:  4, # Vertices:  20, 20
#>                  
#>   common_edges 55
#>  missing_edges  2
#>    extra_edges  6
#>          fnorm  4