move weight constraints into general solver