I ultimately wish to get a subset of my graph by removing connected components with 2 vertices (i.e. both vertices have an edge between them and) You could rephrase this question as:
given an edge e = (s, d) if degree(s) == degree(d) == 1 then delete edge e
I am using R and Igraph, how would I do this? I know I can subset my graph to remove all nodes with zero degree by doing the following:
g = some_graph()
ldegs <- V(g)[degree(g) < 1]
g = delete.vertices(g, ldegs)
Thanks in advance!