addEdges {grapherator} | R Documentation |
Add edges to graph.
Description
This method allows to add edges to a grapherator
graph.
The method can be applied multiple times with different parameterizations. E.g.,
add edges in clusters first and add edges between clusters in a second step.
Usage
addEdges(graph, generator, type = "all", k = NULL, cluster.ids = NULL,
...)
Arguments
graph |
[ |
generator |
[ |
type |
[ |
k |
[ |
cluster.ids |
[ |
... |
[any] |
Value
[grapherator
] Graph.
References
Erdos, P., and A. Renyi. 1959. "On random graphs, I." Publicationes Mathematicae (Debrecen) 6: 290-97.
Waxman, B. M. 1988. "Routing of Multipoint Connections."" IEEE Journal on Selected Areas in Communications 6 (9): 1617-22. doi:10.1109/49.12889.
Knowles, J. D., and D. W. Corne. 2001. "Benchmark Problem Generators and Results for the Multiobjective Degree-Constrained Minimum Spanning Tree Problem." In Proceedings of the 3rd Annual Conference on Genetic and Evolutionary Computation, 424-31. GECCO'01. San Francisco, CA, USA: Morgan Kaufmann Publishers Inc.
See Also
Other graph generators: addNodes
,
addWeights
, graph
Examples
g = graph(0, 1000)
g = addNodes(g, n = 5, generator = addNodesLHS)
g = addNodes(g, n = c(3, 10, 20, 10, 40), by.centers = TRUE, generator = addNodesUniform,
lower = c(0, 0), upper = c(30, 30))
# user different edge generators for clusters
g = addEdges(g, generator = addEdgesDelauney, type = "intracluster", cluster.ids = 1:3)
g = addEdges(g, generator = addEdgesSpanningTree, type = "intracluster", cluster.ids = 4:5)
# link cluster centers
g = addEdges(g, generator = addEdgesSpanningTree, runs = 2, type = "intercenter")
# additional random links between each 2 nodes from each cluster
g = addEdges(g, generator = addEdgesGilbert, p = 0.4, type = "intercluster", k = 2)