Description Objects from the Class Slots Extends Methods Warning Note Author(s) See Also
A class for adjacency list representation of multi-graphs
Objects can be created by calls of the form new("adjacencyList",id,pa,ne)
.
.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
Class "list"
, from data part.
Class "vector"
, by class "list"
.
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
signature(object = "adjacencyList")
: displays an adjacency list representation
signature(x = "adjacencyList")
: gets the character vertex identifiers of an adjacency list
signature(x = "adjacencyList")
: sets the character vertex identifiers of an adjacency list
signature(object = "adjacencyList")
:
returns the number of vertices and the total number of edge occurrences in an adjacency list
signature(object = "adjacencyList")
: an adjacency list is empty if it has no entries
signature(el = "undirectedEdge", ou = "adjacencyList")
:
tells whether an undirected edge occurs in the multi-graph represented by an adjacency list
signature(el = "directedEdge", ou = "adjacencyList")
:
tells whether a directed edge occurs in the multi-graph represented by an adjacency list
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
signature(from = "incidenceList", to = "adjacencyList")
:
converts an incidence list to an adjacency list by dropping all but ordinary directed and undirected edges
signature(from = "incidenceMatrix", to = "adjacencyList")
:
converts an incidence matrix to an adjacency matrix by dropping hyper-edges
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
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.
The names<-
replacement method works only if the names to be assigned
can be used to construct a vertexSet
object having the right cardinality,
otherwise the names are left unchanged and a warning message is given.
Jens Henrik Badsberg, Claus Dethlefsen, Luca La Rocca
adjacencyList
and multiGraph-class
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.