Create an undirected graph from an edge list
Source:R/natural_undirected_graph.R
nug_from_edge_list.RdCreate an undirected graph from an edge list
Arguments
- n
Number of vertices.
- edges
Edge list as a matrix or data frame with two or three columns. The first two columns are vertex indices (1-indexed). Each undirected edge must appear twice (once per direction). An optional third column gives edge weights.
- ...
Additional arguments:
seed(integer) for reproducible RNG.
See also
Other graph-construction:
nug_from_adj_list(),
nug_from_adj_mat(),
nug_from_grid()