Open In App

Objective Function

Last Updated : 22 Apr, 2025
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

Objective Function is the objective of the Linear Programming Problem as the name suggests. In linear programming or linear optimization, we use various techniques and methods to find the optimal solution to the linear problem with some constraints. The technique can also include inequality constraints as well. The objective function in Linear Programming is to optimize to find the optimum solution for a given problem.

As the name suggests, the objective function sets the objective of the Problem.

  • It focuses on decision-making based on constraints.
  • It is a real-valued function that is either to be maximized or minimized, depending upon the constraints.
  • It is like a Profit or a Loss function. It is usually denoted by Z.

Here, we will explore the Objective Function, covering its definition, types, formulation for different problems, and representations such as Linear and Non-linear Objective Functions. Let’s dive into this key concept in Linear Programming.

The terminologies associated with the Objective Function are as follows:

  • Constraints: They are the conditional equations that govern the Linear function
  • Decision Variables: The variables whose values are to be found out. The equations are solved to get the optimal value of these variables.
  • Feasible Region: It is the region in the graph where the constraints are satisfied and the decision variables are found at the corners of the region.
  • Optimum Solution: The best possible solution that satisfies all constraints and achieves the highest or lowest objective.
  • Infeasible Solution: A solution that violates one or more constraints and cannot be implemented or executed.

Objective Function in Linear Programming

In Linear Programming an objective function is a linear function comprising two decision variables. It is a linear function that is to be maximized or minimized depending upon the constraints. If a and b are constants and x and y are decision variables where x > 0 and y > 0, then the Objective function is

Z = ax + by

So in order to get the optimal value of the Optimization function first we need to solve the constraints using any of the techniques and find out the decision variables. Then we put the values of Decision variables in the Objective function to generate the optimal value.

Objective Function in Linear Programming

Formulating an Objective Function

Linear Programming is all about finding the optimal values of the decision variables and putting those values in the objective function to generate the maximum or minimum value. There are many techniques, such as the Simplex Method and the Graphical Method, to solve Linear Programming. However, the Graphical Method is usually preferred because of its simplicity. The steps to get the optimal values of the objective function are as follows:

  • Generate the constraint equations and the objective function from the problem.
  • Plot the constraint equations on the graph.
  • Now identify the feasible region where the constraints are satisfied.
  • Generate the values of Decision variables that are located at the corners of the feasible region.
  • Put all the generated values in the objective function and generate the optimal value.

Common Types of Objective Functions

There are two types of objective functions.

  • Maximization Objective Function
  • Minimization Objective Function

Let's discuss these two types in detail as follows:

Maximization Objective Function

In this type, we usually aim to maximize the objective function. The vertices that are found after graphing the constraints tend to generate the maximum value of the objective function. Let us illustrate with the help of an example.

Example: A man invests at most 8 hrs of time in making wallets and school bags. He invests 2 hrs in making wallets and 4 hr in school bags. He aims to make at most 5 wallets and school bags and wants to sell them and generate a profit of Rs 20 on a wallet and Rs 100 on a school bag. Find the objective function.

Solution:

Let x be the number of rotis and y be the number of bread.

A man can invest a maximum of 8 hours by investing 2 hours on making a wallet and 4 hour on making a school bag. Therefore the first constraint equation is

2x + 4y ⩽ 8
⇒ x + 2y ⩽ 4

The maximum number he can make is 5

x+y ⩽ 5

Let the objective function be denoted by Z
Therefore Z = 20x + 100y

Minimization Objective Function

In this type, we usually aim to minimize the objective function. The vertices that are found after graphing the constraints tend to generate the minimum value of the objective function. Let us illustrate with the help of an example.

Example: Given that the sum of the two variables is at least 20. It is given that one variable is greater than or equal to 9. Derive the objective function if the cost of one variable is 2 units and the cost of another variable is 9 units.

Solution:

Let x and y be the two variables. It is given sum of the two variables should be at least 20.

x+y ⩾ 20
and x ⩾ 9

Above two inequalities are constraints for the following objective function.

Let the objective function be denoted by Z. Therefore Z is
Z = 2x + 9y 

Mathematical Representation of Objective Function

As we discussed on the objective function in the context of linear programming, but objective function can be non-linear as well.

  • Linear Objective Functions: In this type of objective function, both the constraints and the objective functions are linear. The exponents of the variables are 1.
  • Non-Linear Objective Functions: In this type of objective function, both the constraints and the objective functions are linear. The exponents of the variables are either 1 or greater than 1.

Applications of Objective Functions

The various applications of the objective function are as follows:

  • Manufacturing Problem: In a factory, making different products takes machine time, workers' time, and space to store the products. To make the best use of these resources and keep the cost low, we can use a method called linear programming. It helps decide how many units of each product to make.
  • Diet Problem: When planning a healthy diet, we need the right mix of nutrients like proteins, vitamins, and minerals, but we also want to keep costs low. We can use linear programming to figure out how much of each food item to include in the diet so that it is both healthy and affordable.
  • Transportation Problem: When goods need to be delivered to different places, we want to choose the best routes. The goal is to reduce travel distance, save fuel, and cover more drop-off points. This is also an optimization problem that can be solved using linear programming to find the best route plan.

Solved Problems on the Objective Function

Problem 1: A person wants some belts and wallets. He has total savings of Rs 6000 and wishes to spend all his savings on purchasing belts and wallets so that he can sell them later. The value of the wallet is Rs 20, and the value of the belt is Rs 10. He wants to store them in a cupboard, and the maximum capacity of the cupboard is 50 units. He expects a profit of Rs 2 on the belt and Rs 3 on the wallet. Find the constraints and the resulting objective function.

Solution:

Let the x be the number of wallets to be purchased and y be the number of belts to be purchased. It is to be noted whenever maximum is mentioned in the problem we should use '⩽' to find the constraints

The maximum investment is Rs 6000. The first constraint equation is
20x + 10y ⩽ 6000

The max storage capacity of the cupboard is 50
x+y ⩽ 50

Here profit function is basically the objective function. Let this be denoted by Z. Therefore the profit function is
Z = 3x + 2y

Problem 2: Identify the constraint equations and the objective function from the given set

  • 2x + 3y ⩾ 50
  • x + y ⩽ 50
  • 5x + 4y ⩽ 40
  • Z = 7x + 8y

Where x and y are greater than 0.

Solution:

The constraints can be inequality or inequality format. But an objective function has always an equality symbol

Therefore the constraint equations are

2x + 3y ⩾ 50
x + y ⩽ 50
5x + 4y ⩽ 40

The objective equation is Z = 7x + 8y

Problem 3: A woman invests at most 7 hrs of time in making rotis and bread. She invests 2 hrs on rotis and 4 hr on bread. She aims to make at most 20 bread and rotis and wants to sell them and generate a profit of Rs 2 on roti and Rs 1 on bread. Find the objective function.

Solution:

Let x be the number of rotis and y be the number of bread.

A woman can invest a maximum of 7 hours by investing 2 hours on making a roti and 4 hour on making a bread. Therefore the first constraint equation is
2x + 4y ⩽ 7

The maximum number of bread and rotis she can make is 20
x + y ⩽ 20

Let the objective function be denoted by Z
Therefore Z = 2x + y.

Problem 4: The company wants to manufacture Product A and Product B. Product A requires 4 units of cocoa powder and 1 unit of milk powder. Product B requires 3 units of cocoa powder and 2 units of milk powder. There are 87 units of cocoa powder available and 45 units of milk powder available. The profit to be earned on each product is $3 and $5, respectively. Find the objective function.

Solution:

Let x denote the number of Product A and y denote the number of items of type B.

The maximum quantity of cocoa powder is 87 units. So the first constraint equation is
4x + 3y ⩽ 87

The maximum amount of milk powder available is 45 units. So the second constraint equation is
x + 2y ⩽ 45

Here our aim is to maximize the profit. So our profit function is the Objective function. Let it be denoted by Z
Z = 3x + 5y

Problem 5: Two types of food packets A and B are to be generated which comprise of vitamins. There are at least 45 units of food packet A to be made available and the manufacture of both food packets should be at least 30. Generate the objective function to be generated where food packet A has 6 units of vitamins and food packet B has 8 units.

Solution:

Let x be the number of food packets A and y be the number of food packets B

At least 45 food packets are to be made available. Therefore the first constraint equation is
x ⩾ 45

The second constraint equation is
x + y ⩾ 30

The objective function is as follows:
Z = 6x + 8y

Conclusion

The objective function plays a critical role in optimization problems,, serving as the mathematical expression that needs to be maximized or minimized. Whether in economics, engineering, machine learning, or operations research, the objective function defines the goal of the optimization process. By clearly understanding and defining the objective function, practitioners can ensure that the solutions they obtain are not only mathematically sound but also aligned with the real-world goals they seek to achieve.


Similar Reads