Added code for building Constraint Graph