get_largest_component: Get largest connected component

View source: R/utils.R

get_largest_componentR Documentation

Get largest connected component

Description

Get the indices of the vertices in the largest connected component of a graph from its adjacency matrix.

Usage

get_largest_component(adj_mat)

Arguments

adj_mat

An adjacency matrix of a graph.

Value

A vector of indices corresponding to the vertices in the largest connected component.

Examples

adj_mat <- matrix(c(0, 1, 0, 0, 0, 0, 0, 0, 0), nrow = 3)
get_largest_component(adj_mat)

motifcluster documentation built on Nov. 18, 2022, 9:06 a.m.