Most WSNs suffer from huge resource constraints, and most of the problems that are to be optimized are NP-hard problems, so the cost of simulators or mathematical programming engines used for linear, nonlinear and quadratic programming make them unattractive.