Learn R Programming

aion (version 1.6.0)

graph_prune: Prune a Graph

Description

Removes redundant relations from a graph.

Usage

graph_prune(object, ...)

# S4 method for igraph graph_prune( object, reduce = TRUE, remove_multiple = TRUE, remove_loops = TRUE, ... )

Value

An igraph graph object.

Arguments

object

An igraph object (typically returned by graph_create()).

...

Currently not used.

reduce

A logical scalar: should transitive reduction be performed? Only used if object is a directed acyclic graph.

remove_multiple

A logical scalar: should multiple edges be removed?

remove_loops

A logical scalar: should loop edges be removed?

Author

N. Frerebeau

See Also

Other graph tools: graph_create()

Examples

Run this code
if (requireNamespace("igraph", quietly = TRUE) &&
    requireNamespace("relations", quietly = TRUE)) {
  ## Seven intervals
  int <- intervals(
    start = c(1, 2, 3, 6, 9, 13, 17),
    end = c(7, 4, 15, 14, 11, 18, 19),
    calendar = CE(),
    names = c("A", "B", "C", "D", "E", "F", "G")
  )

  ## Interval graph
  g <- graph_create(int, type = "interval")
  plot(g)

  ## Stratigraphic graph
  g <- graph_create(int, type = "strati")
  g <- graph_prune(g) # Remove redundant relations
  plot(g, layout = igraph::layout_with_sugiyama)
}

Run the code above in your browser using DataLab