Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

allEdges

All edges of a graph


Description

Finds the set of edges of a graph. That is the set of undirected edges if the graph is undirected and the set of arrows if the graph is directed.

Usage

allEdges(amat)

Arguments

amat

a square Boolean matrix, with dimnames, the adjacency matrix of a graph.

Value

a matrix with two columns. Each row of the matrix is a pair of indices indicating an edge of the graph. If the graph is undirected, then only one of the pairs (i,j), (j,i) is reported.

Author(s)

Giovanni M. Marchetti

See Also

Examples

## A UG graph
allEdges(UG(~ y*v*k +v*k*d+y*d))

## A DAG
allEdges(DAG(u~h+o+p, h~o, o~p))

ggm

Graphical Markov Models with Mixed Graphs

v2.5
GPL-2
Authors
Giovanni M. Marchetti, Mathias Drton, Kayvan Sadeghi
Initial release
2020-02-014

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.