> Of the vertices 1:26, I can also choose two nodes that are not consecutive, as in, I can choose to merge (1,5) or (7,18) into a single vertex. Can this be done?
Quoting myself:
> In general, if you want to merge vertex v into vertex u (assuming that v > u), you will need a contraction vector as follows:
>
> vec <- c(1:(v-1), u, v:(vcount(g)-1))
>
> If v < u, just swap u and v and do the same thing.
In your case, u=1 and v=5 (since you are merging node 5 into node 1), so the contraction vector is:
c(1:4, 1, 5:(vcount(g)-1))