Abstract the edges and nodes
Cleanup union find code and main stars code