major fixes in cluster and solution

pass G by reference for cluster
pass G by value for solution