graph now has solution and connected components