Objects from the Class
Objects can be created by calls of the form new("adjacencyList",id,pa,ne)
.Slots
.Data
:- Object of class
"list"
; each element represents a vertex and is in turn a list
of (at most) three elements, namely pa
, ne
and ch
storing, respectively, the numeric identifiers
of parents, neighbours and children
Extends
Class "list"
, from data part.
Class "vector"
, by class "list"
.Methods
- initialize
signature(.Object = "adjacencyList")
:
constructs an adjacency list representation of a multi-graph from a vertex set id
,
a list pa
of parent numeric identifiers, a list ch
of children numeric identifiers,
and a list ne
of neighbour numeric identifiers - show
signature(object = "adjacencyList")
: displays an adjacency list representation - names
signature(x = "adjacencyList")
: gets the character vertex identifiers of an adjacency list - names<-
signature(x = "adjacencyList")
: sets the character vertex identifiers of an adjacency list - card
signature(object = "adjacencyList")
:
returns the number of vertices and the total number of edge occurrences in an adjacency list - isEmpty
signature(object = "adjacencyList")
: an adjacency list is empty if it has no entries - isPresent
signature(el = "undirectedEdge", ou = "adjacencyList")
:
tells whether an undirected edge occurs in the multi-graph represented by an adjacency list - isPresent
signature(el = "directedEdge", ou = "adjacencyList")
:
tells whether a directed edge occurs in the multi-graph represented by an adjacency list - areTheSame
signature(x = "adjacencyList", y = "adjacencyList")
:
x and y are the same adjacency list if they represent the same multi-graph - [
signature(x = "adjacencyList")
: extracts the adjacency list of an induced subgraph - [[
signature(x = "adjacencyList")
: extracts the character identifier of a vertex - coerce
signature(from = "incidenceList", to = "adjacencyList")
:
converts an incidence list to an adjacency list by dropping all but ordinary directed and undirected edges - coerce
signature(from = "incidenceMatrix", to = "adjacencyList")
:
converts an incidence matrix to an adjacency matrix by dropping hyper-edges - coerce
signature(from = "adjacencyMatrix", to = "adjacencyList")
:
converts an adjacency matrix to an adjacency list - +
signature(e1 = "adjacencyList", e2 = "vertexSet")
:
adds a vertex set to an adjacency list by making the new vertices isolated - -
signature(e1 = "adjacencyList", e2 = "vertexSet")
:
removes a vertex set from an adjacency list by dropping all edges involving the vertex set - +
signature(e1 = "adjacencyList", e2 = "undirectedEdge")
:
adds an ordinary undirected edge to an adjacency list - +
signature(e1 = "adjacencyList", e2 = "directedEdge")
:
adds an ordinary directed edge to an adjacency list - -
signature(e1 = "adjacencyList", e2 = "undirectedEdge")
:
removes an undirected edge from an adjacency list - -
signature(e1 = "adjacencyList", e2 = "directedEdge")
:
removes a directed edge from an adjacency list - *
signature(e1 = "adjacencyMatrix", e2 = "vertexSet")
:
restricts an adjacency matrix to a vertex set by dropping all edges involving vertices outside the vertex set
Warning
The pa
, ch
and ne
constructor input lists are silently discarded
if their length differs from the actual number of vertices (determined by id
). All input numeric identifiers
greater than this number are also silently discarded by the constructor. The id
input to constructor is mandatory,
since the constructor needs to identify vertices. In addition, at least one between pa
and ch
should be present,
if directed edges have to be specified, and ne
should be present, if undirected edges have to be specified.
If both pa
and ch
are present, the union of the two corresponding multi-sets of edges is specified.
If the neighbourhood relationship specified by ne
is not symmetric, it is made symmetric by the constructor.