The gating and riser layout for this ductile iron casting was optimized with MAGMASOFT ®. The optimization target was simple and clear. A minimum of porosity and a minimum riser volume should be achieved at the same time. But, a real challenge was the definition of constraints for the optimization algorithm. Where in the casting do we need which microstructure (nodule count, pearlite/ferrite ratio) to fulfill the specification of 700 MPa tensile strength? What is the lowest acceptable and the highest allowed value?