Handling graphs in R

In R, the set of nodes (V) and the set of arcs (E) are data structures of different types. For V, once we assign a unique identifier to each node, then we can access every node without ambiguity. Hence, it is like saying that the data structure hosting the properties of the nodes is one-dimensional and, therefore, is a vector.

On the contrary, the data structure for the set of arcs (links between nodes) E cannot be a vector and it does not express the characteristics of single objects but expresses relations between pairs of objects (pairs of nodes in this case). So if, for example, in V (the set of nodes) there are 10 nodes, then the dimensions of E will be 10 × 10 or all of the relationships between all of the possible ...

Get Hands-On Reinforcement Learning with R now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.