I don't understand how you will use the gradient descent algorithm. this is a constraint satisfaction problem, gradient descent gives an optimal solution that may not always satisfy the given constraints.
Tell your friends
Great! You have been registered to the challenge, now tell your friends about it.