Over a million developers have joined DZone.

Objectives and Constraints

DZone's Guide to

Objectives and Constraints

How do these two concepts interrelate in software development? We look at it from a mathematical perspective and go from there.

· Agile Zone ·
Free Resource

Discover how you can take agile development to the next level with low-code.

Objectives and constraints are symmetrical in a mathematical sense but are asymmetrical in a psychological sense. By taking dual formulations, you can reverse the mathematical role of objectives and constraints, but in application objectives are more obvious than constraints.

In the question "What is the minimum value of x² over the interval [1, 5]?" the function f( x) = x² is the objective function and 1 ≤ x ≤ 5 is the constraint. If someone says the minimum is 0, they've minimized the objective function but ignored the constraint. This is clear in a such a simple problem, but failure to consider constraints can be much more subtle.

Objectives tend to be easily quantifiable

Maximize profit, minimize energy consumption, etc., but constraints tend to be less quantifiable. The solution has to be testable and maintainable, has to be legal, has to be something people will buy or vote for, etc.

When children ask, "Why don't you just ..." It's because they see a way to improve some objective, but the "just" part shows that they are either completely unaware of a relevant constraint or are unaware of how difficult it would be to overcome the constraint. As you mature, you become aware of more constraints. You realize that things that seem grossly subopitmal are actually close to optimal when you consider the necessary constraints. There may be room for improvement, but not as much as you imagined and at a higher cost.

Big opportunities open up when constraints change

Maybe an idea was abandoned because it would require more calculation than anyone could carry out by hand, and now's the time to revisit it. Or maybe an idea was never developed because it would require instantaneous communication between people at multiple points on the globe. No problem now.

In both the examples above, a constraint was relaxed: computation and communication have gotten far less expensive. Increased constraints create opportunities as well. When the price of something goes up, its alternatives become more economical by comparison. Whether an oil field is worth developing, for example, depends on the current price of oil.

If I ask "Why hasn't someone done this before?" I'm skeptical if the answer is "Because I'm smarter than everyone else who has tried." But if the answer is "Because constraints have changed" then I'm much more receptive.

Download this eBook to learn how to prepare your business for agile adoption, how to ensure the proper business-IT collaboration that is critical for agile development, and how to choose the right stakeholders to increase productivity and enable accelerated time-to-value.

math ,objectives ,constraints ,software ,data-driven development ,Agile

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}