add basic constraint weight optimization