Added the constraint which ensures that only ports of the same type are connected