# Contracting Several nodes into one node [closed]

After finding the Strongly Connected Components of a graph and putting each SCC in a list, how i can contract each list of nodes into one node?

Thanks!

• This seems to be a programming question, which is offtopic here. Or is there a conceptual question you're having? (Community votes, please!) – Raphael Feb 17 '16 at 11:24
• In any case, what have you tried? Where did you get stuck? We do not want to just do your (home-)work for you; we want you to gain understanding. However, as it is we do not know what your underlying problem is, so we can not begin to help. See here for a relevant discussion. If you are uncertain how to improve your question, why not ask around in Computer Science Chat? You may also want to check out our reference questions. – Raphael Feb 17 '16 at 11:25

Traverse the edges of the graph once more. For every edge (x,y):
• If x and y belong to the same SCC you do nothing.
• Else insert edge (SCC[x],SCC[y]) in a new graph (the graph of strongly connected components).