read_simple_graph: Read a graph from file, simplifying as requested

View source: R/orca_interface.R

read_simple_graphR Documentation

Read a graph from file, simplifying as requested

Description

Reads graph data from file, constructing an a igraph graph object, making 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

read_simple_graph(
  file,
  format,
  as_undirected = TRUE,
  remove_loops = TRUE,
  remove_multiple = TRUE,
  remove_isolates = TRUE
)

Arguments

file

Path to file containing graph data

format

Format of graph data. All formats supported by igraph::read_graph are supported.

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.