Skip to contents

Add an undirected edge from v1 to v2 to graph g if it does not already exist.

Usage

add_unique_edge(g, v1, v2)

Arguments

g

Graph representing social network

v1

First node in edge pair

v2

Second node in edge pair

Value

igraph Graph

Examples

# Add one unique edge between nodes 1 and 4 to empty ten-node network
g <- igraph::make_empty_graph(n = 10)
g <- add_unique_edge(g, 1, 4)