graph_extract_components function

Component extraction of a graph

Component extraction of a graph

This function extracts all connected components of the input, which can be an "igraph" object or a "network" object, and converts them to "igraph" objects.

graph_extract_components( x, directed = TRUE, bipartite_proj = FALSE, num_proj = 1 )

Arguments

  • x: An igraph or a network object.
  • directed: Whether to create a directed graph (default = TRUE).
  • bipartite_proj: Whether the bipartite network must be projected or not (default = FALSE).
  • num_proj: Numbers 1 or 2 that show the number of projects for bipartite graphs (default = 1).

Returns

A list including the components of the input as igraph objects. The output is a list where each element represents a component and is an igraph object. The components are disconnected subgraphs of the input graph.

A list including the components of the input as igraph objects.

Details

This function separates different components of an "igraph" or a "network" object and illustrates them as a list of independent graphs. If the input graph was bipartite and the "bipartite_proj" was TRUE, it will project it, and you can decide in which project you want to continue working with.

Examples

data(zachary) graph_extract_components(zachary)

See Also

induced.subgraph, components

Author(s)

Minoo Ashtiani, Mehdi Mirzaie, Mohieddin Jafari

  • Maintainer: Minoo Ashtiani
  • License: GPL-3
  • Last published: 2023-08-08

Useful links