In iGraph, I want to take a graph such as this one:
edgelist <- c(c(1,2),c(1,3),c(1,4),c(4,5),c(4,6))
graph <- make_graph(edgelist, directed=F)
and turn it into this one:
edgelist <- c(c(7,2),c(7,3),c(7,5),c(7,6))
graph <- make_graph(edgelist, directed=F)
Where 7 is now the combined node of 1 and 4, and it inherits the edges of 1 and 4. Is there a way to do this with graph already created?