I am currently working through some graph theory problems and have a question I can't seem to find an answer to. When creating a graph using:
x <- graph_from_data_frame(el, directed = F, vertices = x)
The addition of the vertices = x creates components of size = 1.
I want to look at cluster size i.e. extracting the components and looking at a table of size using:
comp <- components(x)
table(comp$csize)
Given the nature of edgelists, I would expect no clusters to have size <= 2, seeing as the edgelist is the relationship between two nodes.If I run the exact same code without the vertices = x, my table will start with clusters of size = 2.
Why does the addition of vertices = x do this?
Thanks
EDIT:
My edgelist has the variables:
ID ID.2 soure
x1 x2 healthcare
x1 x3 child benefit
The vertices data frame contains general information for the nodes(IDs)
ID date_of_birth nationality
x1 02/09/1999 French
x2 12/12/1997 French
x3 22/01/2002 French