added optional name for constraints. raising a CycleException if a cycle is detected