transReduct: Remove transitive edges from an adjacency matrix

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/transReduct.R

Description

This function removes transitive edges from an adjacency matrix.

Usage

1

Arguments

e

an adjacency matrix, i.e. a rectangular matrix with value e_{i,j} above zero indicating an edge between vertices i and j of the corresponding graph.

Details

This function takes an adjacency matrix as the argument e. Both rows and columns correspond to graph vertices, with value e_{i,j} above zero indicating an edge between vertices i and j. The function removes all transitive edges, i.e. sets to zero corresponding elements of matrix e. The transitive edge is such an edge between vertices i and j that after removing it from the graph, there still exists a path from i to j.

Value

An adjacency matrix e with transitive edges being removed.

Author(s)

Michal Burda

See Also

paircomp, hasse

Examples

1
2
  e <- matrix(c(0, 1, 1, 0, 0, 1, 0, 0, 0), nrow=3, byrow=TRUE)
  transReduct(e)

Example output

Loading required package: Rgraphviz
Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Loading required package: grid
     [,1] [,2] [,3]
[1,]    0    1    0
[2,]    0    0    1
[3,]    0    0    0

paircompviz documentation built on Nov. 8, 2020, 6:26 p.m.