simplify_graph: Simplify an igraph

View source: R/orca_interface.R

simplify_graphR Documentation

Simplify an igraph

Description

Takes a igraph graph object and makes the requested subset of the following simplifications in the following order: 1. Makes the graph undirected 2. Removes loops (where both endpoints of an edge are the same vertex) 3. Removes multiple edges (i.e. ensuring only one edge exists for each pair of endpoints) 4. Removes isolated vertices (i.e. vertices with no edges after the previous alterations)

Usage

simplify_graph(
  graph,
  as_undirected = TRUE,
  remove_loops = TRUE,
  remove_multiple = TRUE,
  remove_isolates = TRUE
)

Arguments

graph

An graph or list of graphs in igraph format

as_undirected

If TRUE make graph edges undirected

remove_loops

If TRUE, remove edgeds that connect a vertex to itself

remove_multiple

If TRUE remove multiple edges connencting the same pair of vertices

remove_isolates

If TRUE, remove vertices with no edges after the previous alterations have been made

Value

A simplified igraph graph object


alan-turing-institute/network-comparison documentation built on June 7, 2022, 10:41 p.m.