Without more information about f and g, this problem is NP-hard to solve. The topic is quite broad, check the family of [Branch and Bound][1] algorithms, depending of additional information you can do better than NP-hard, in particular, it makes use of monotonicity to guide its search. Worth to mention too are Genetic algorithms and Simulated Annealing, which, in general, gives you a good enough solution. [1]: https://en.wikipedia.org/wiki/Branch_and_bound