add constraints to nodes