Objects from the Class
Objects can be created by calls of the form new("generalGraph", ...)
.
A generalGraph
object consists of two slots, one for each possible representation:
incidenceMatrix
and incidenceList
.Slots
incidenceMatrix
:- Object of class
"incidenceMatrix"
incidenceList
:- Object of class
"incidenceList"
Extends
Class "anyGraph"
, directly, with explicit coerce.Methods
- initialize
signature(.Object="generalGraph")
:
constructs a general graph from one of the two possible representations - show
signature(object = "generalGraph")
: displays the available representations of a general graph - display
signature(x = "generalGraph")
: static graphical representation via package 'mathgraph' - dynamic.Graph
signature(object = "generalGraph")
:
dynamic graphical representation via package 'dynamicGraph' - incidenceList<-
signature(x = "generalGraph")
: sets the incidence list representation - incidenceMatrix<-
signature(x = "generalGraph")
: sets the incidence matrix representation - incidenceList
signature(object = "generalGraph")
: gets the incidence list representation - incidenceMatrix
signature(object = "generalGraph")
: gets the incidence matrix representation - names
signature(x = "generalGraph")
: gets the character vertex identifiers of a general graph - names<-
signature(x = "generalGraph")
: sets the character vertex identifiers of a general graph - card
signature(object = "generalGraph")
:
returns the number of vertices and the total number of edge occurrences in a general graph - isEmpty
signature(object = "generalGraph")
:
a graph object is empty if all its possible representations are empty - isPresent
signature(el = "edge", ou = "generalGraph")
:
an edge occurs in a graph object if it occurs in its non-empty slots - areTheSame
signature(x = "generalGraph", y = "generalGraph")
:
x and y are the same if their non-empty slots represent the same graph - [
signature(x = "generalGraph")
: extracts an induced subgraph - [[
signature(x = "generalGraph")
: extracts the character identifier of a vertex - coerce
signature(from = "anyGraph", to = "generalGraph")
:
all but directed and undirected edges are lost in the conversion - coerce
signature(from = "multiGraph", to = "generalGraph")
:
no edges are lost in the conversion as every multi-graph is a general graph - coerce
signature(from = "simpleGraph", to = "generalGraph")
:
no edges are lost in the conversion as every simple-graph is a general graph - coerce
signature(from = "generalGraph", to = "dg.graph")
:
conversion to class 'dg.graph' of package 'dynamicGraph' - +
signature(e1 = "generalGraph", e2 = "vertexSet")
:
adds a vertex set to a general graph by making the new vertices isolated - -
signature(e1 = "generalGraph", e2 = "vertexSet")
:
removes a vertex set from a general graph by dropping all edges involving the vertex set - +
signature(e1 = "generalGraph", e2 = "edge")
:
adds an edge to a general graph - -
signature(e1 = "generalGraph", e2 = "edge")
:
removes an edge from a general graph - *
signature(e1 = "generalGraph", e2 = "vertexSet")
:
restricts a general graph to a vertex set by dropping all edges involving vertices outside the vertex set