g = ;

comp=Select[ConnectedComponents[g],Length[#]>1&];

HighlightGraph[g,Table[Style[comp[[i]],ColorData["Rainbow"][(i-1)/Length[comp]]],{i,Length[comp]}],ImageSize->450]