Your program should take 3 inputs:
A positive integer which is the number of variables,
A set of unordered pairs of nonnegative integers, where each pair represents an equality between ...
The maxima and minima of a given function are the largest and smallest values of the function either within a given range or otherwise within the entire domain of the function.
Code Golf Stack Exchange is a site for recreational programming competitions, not general programming questions. Challenges must have an objective scoring criterion, and it is highly recommended to first post proposed challenges in the Sandbox.