Learn R Programming

motifcluster (version 0.2.3)

get_largest_component: 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)

Value

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

Arguments

adj_mat

An adjacency matrix of a graph.

Examples

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

Run the code above in your browser using DataLab