Function to add edges into a graph. The following methods are implemented so far:
addEdgesCompleteGenerates a simple complete graph. I.e., an edge exists between each two nodes. However, no self-loops or multi-edges are included.
addEdgesGridOnly usefull if nodes are generated via addNodesGrid.
This method generates a Manhattan-like street network.
addEdgesOnionThis method determines the nodes on the convex hull
of the node cloud in the euclidean plane and adds edges between neighbour nodes.
Ignoring all nodes on the hull, this process is repeated iteratively resulting in an
onion like peeling topololgy. Note that the graph is not connected! In order to
ensure connectivity, another edge generator must be applied in addition, e.g.,
addEdgesSpanningTree.
addEdgesDelauneyEdges are determined by means of a Delauney triangulation of the node coordinates in the Euclidean plane.
addEdgesWaxmanEdges are generated using the Waxman-model, i.e., the probability \(p_{ij}\) for the edge \((i, j)\) is given by $$p_{ij} = \alpha e^{-\beta d_{ij}}$$, where \(\alpha, \beta \geq 0\) are control parameters and \(d_{ij}\) is the Euclidean distance of the nodes \(i\) and \(j\).
addEdgesSpanningTreeA minimum spanning tree is computed based on
a complete random weight matrix. All edges of the spanning tree are added. If runs
is greater 1, the process is repeated for runs. However, already added edges are
ignored in subsequent runs.
This method is particularly useful to assist probablistic methods, e.g., Waxman model,
in order to generate connected graphs.
addEdgesGilbertUse Gilbert-model to generate edges. I.e., each edge is added with probability \(p \in [0, 1]\).
addEdgesErdosRenyiIn total \(m \leq n(n-1)/2\) edges are added at random.
addEdgesComplete(graph, ...)addEdgesGrid(graph, ...)
addEdgesOnion(graph, ...)
addEdgesDelauney(graph, ...)
addEdgesWaxman(graph, alpha = 0.5, beta = 0.5, ...)
addEdgesGilbert(graph, p, ...)
addEdgesErdosRenyi(graph, m, ...)
addEdgesSpanningTree(graph, runs = 1L, ...)
[grapherator]
Graph.
[any] Not used at the moment.
[numeric(1)]
Positive number indicating the average degree of nodes in the Waxman model.
Default is 0.5.
[numeric(1)]
Positive number indicating the scale between short and long edges in the Waxman model.
Default is 0.5.
[numeric(1)]
Probability for each edge \((v_i, v_j), i, j = 1, \ldots, n\) to be added
for Gilbert graphs.
[integer(1)]
Number of edges to sample for Erdos-Renyi graphs.
Must be at most \(n(n-1)/2\) where \(n\) is the number of nodes of graph.
[integer(1)]
Number of runs to perform by addEdgesSpanningTree.
Default is 1.
[list] List with components:
matrixAdjacency matrix.
character(1)]String description of the generator used.
Currently all edge generators create symmetric edges only.