gEdge-class {graph}R Documentation

Class "gEdge"

Description

A very generic class for describing the edges of a graph.

Objects from the Class

Objects can be created by calls of the form new("gEdge", ...).

Slots

edgeID:
Object of class "Ruuid" a unique identifier for the edge.
edgeType:
Object of class "character" the type of edge.
bNode:
Object of class "Ruuid" identifier of beginning node for the edge.
eNode:
Object of class "integer" identifier of ending node for the edge.
property:
Object of class "list", holds properties associated with the edge. It always contains at least one element of type numeric named "weight"

Extends

Class "propertyHolder", directly.

Methods

bNode
signature(object = "gEdge"): A method that returns the identifier for the begining node of the edge.
eNode
signature(object = "gEdge"): A method that returns the identifier for the ending node of the edge.
edgeID
signature(object = "gEdge"): A method that returns the edge identifier.
idstring
signature(x = "gEdge"): A method that returns the edge identifier as a character string.
initialize
signature(.Object = "gEdge", ...): initializer for "gEdge" class.

Note

Based on GXL's definition of edges.

Author(s)

R. Gentleman and Saikat DebRoy

See Also

gNode-class

Examples

nodeA <- new("gNode", label="A")
nodeB <- new("gNode", label="A")
edgeAB <- new("gEdge", bNode=nodeA, eNode=nodeB)
idstring(edgeAB)
bNode(edgeAB) == nodeID(nodeA)
eNode(edgeAB) == nodeID(nodeB)
fromEdges(nodeA) <- fromEdges(nodeB) <- list(edgeAB)
toEdges(nodeA) <- toEdges(nodeB) <- list(edgeAB)
fromEdges(nodeA)
toEdges(nodeA)
fromEdges(nodeB)
toEdges(nodeB)

[Package graph version 1.8.0 Index]