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

listEdges

List the Edges of a Graph


Description

A list where each element contains all edges between two nodes, regardless of orientation. The list has names which are node pairs, in lexicographic order, and elements all edges between those nodes.

Usage

listEdges(object, dropNULL=TRUE)

Arguments

object

An instance of the graphNEL-class class.

dropNULL

Should those node pairs with no edges be dropped from the returned list.

Details

The function is currently only implemented for graphs of the graphNEL-class. The edges in the returned list are instances of the simpleEdge-class.

Value

A named list of simpleEdge-class objects.

Author(s)

R. Gentleman

See Also

Examples

set.seed(123)
        V <- LETTERS[1:4]
        edL <- vector("list", length=4)
        names(edL) <- V
        toE <- LETTERS[4:1]
        for(i in 1:4) 
           edL[[i]] <- list(edges=5-i, weights=runif(1))
        gR <- graphNEL(nodes=V, edgeL=edL)
        listEdges(gR)

graph

graph: A package to handle graph data structures

v1.68.0
Artistic-2.0
Authors
R. Gentleman, Elizabeth Whalen, W. Huber, S. Falcon
Initial release

We don't support your browser anymore

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