What you're doing will work, except that you need to remove the original 'root' node as well.
Fundamentally, you have three choices: 1. Do what you're doing now. 2. Write your own code to collect the neighbors of u's neighbors in a set. If this is a bipartite graph, then you only have to remove the root and you're done. This is probably more space efficient, because the set you're building is never bigger than it has to be. 3. If this is a bipartite graph, use a hypergraph instead, where the nodes are users and the hyperedges are threads. Then you just ask the hypergraph for the nodes' neighbors.