0% found this document useful (0 votes)
12 views33 pages

OTDM file

The document is a lab file for the Optimization Techniques and Decision Making course at Indira Gandhi Delhi Technical University for Women, specifically for BTech 4th semester students in the Department of Artificial Intelligence and Data Science for the academic session 2023-2024. It includes a series of experiments that involve writing Python programs to solve various optimization problems, such as partitioning arrays, minimizing sums, and using linear programming methods. Each experiment outlines the task, provides code examples, and includes a structure for submission.

Uploaded by

tanu144btcsai22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ZIP, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views33 pages

OTDM file

The document is a lab file for the Optimization Techniques and Decision Making course at Indira Gandhi Delhi Technical University for Women, specifically for BTech 4th semester students in the Department of Artificial Intelligence and Data Science for the academic session 2023-2024. It includes a series of experiments that involve writing Python programs to solve various optimization problems, such as partitioning arrays, minimizing sums, and using linear programming methods. Each experiment outlines the task, provides code examples, and includes a structure for submission.

Uploaded by

tanu144btcsai22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ZIP, PDF, TXT or read online on Scribd
You are on page 1/ 33

Indira Gandhi Delhi Technical University for

Women

OPTIMIZATION TECHNIQUES

AND DECISION MAKING LAB FILE

BTech - 4th Semester


Department of Artificial Intelligence and Data Science
Academic Session: 2023-2024

Submitted To: Submitted


By:

Ms. Jyoti Gupta Tanu Raman


(
1440117202
2)

C
SE-AI-2

1
INDEX

S.No Topic Signature

1 Experiment 1

2 Experiment 2

3 Experiment 3

4 Experiment 4

5 Experiment 5

6 Experiment 6

7 Experiment 7

8 Experiment 8

9 Experiment 9

10 Experiment 10

2
EXPERIMENT 1

Write a Python program to find out when given an array of size N,


the task is to partition the given array into two subsets such that
the average of all the elements in both subsets is equal. If no such
partition exists print -1. Otherwise, print the partitions. If multiple
solutions exist, print the solution where the length of the first
subset is minimum. If there is still a tie then print the partitions
where the first subset is lexicographically smallest.

CODE:

3
EXAMPLE:

4
EXPERIMENT 2

Write a Python program to find out when given an array of positive


elements, you have to flip the sign of some of its elements such that the
resultant sum of the elements of array should be minimum non-negative
(as close to zero as possible). Return the minimum no. of elements whose
sign needs to be flipped such that the resultant sum is minimum non-
negative. Note that the sum of all the array elements will not exceed 104.

CODE:

EXAMPLE:

5
EXPERIMENT 3

Write a Python program to find out when given a two dimensional grid, each
cell of which contains integer cost which represents a cost to traverse through
that cell. The task is to find the maximum cost path from the bottom-left
corner to the top-right corner.

CODE:

EXAMPLE:

6
EXPERIMENT 4

Write a Python program to find out when given an array of non-


negative integers arr[], the task is to find a pair (n, r) such that nPr is
maximum possible and r ≤ n.

CODE:

EXAMPLE:

7
EXPERIMENT 5

Write a python program to use graphical method to solve linear


programming problem and test your program on the following
examples:

1.Maximize/Minimize (3x1 + 2x2) Subject to 2x1 +4x2< = 8, 3x1 +


5x2>= 15, x1>=0, x2>= 0.
1.Maximize/Minimize (3x1 + 2x2) Subject to 2x1 +4x2< = 8, 3x1 +
5x2<= 15, x1>=0, x2>= 0

CODE:
8
EXAMPLE:

9
EXPERIMENT 6

Write a python program to Use simplex method for solving linear


programming problem with ≤ type constraints and test your program
on the following examples:
1.Min. z = 3x1 + 5x2, Subject To. x1 + 3x2 ≥ 3, x1 + x2 ≥ 2, x1, x2 ≥
0.
1.Min. z = 12x1 + 10x2, S.T. 5x1 + x2 ≥ 10, 6x1 + 5x2 ≥ 30, x1 + 4x2
≥ 8, x1, x2 ≥ 0.
1.Max. z = 3x1 + 2x2, S.T. x1 + x2 ≤ 2, x1 + 3x2 ≤ 3, x1 − x2 = 1, x1,
x2 ≥ 0.

PART 1:

PART 2:
10
PART 3:

1
1
EXPERIMENT 7

Perform analysis of optimal solution of graphical method Linear


Programming Problem using TORA (software).

12
EXPERIMENT 8
Perform analysis of optimal solution of simplex method Linear
Programming Problem using TORA (software).

13
EXPERIMENT 9

Perform analysis of optimal solution of Big M method Linear


Programming Problem using TORA (software).

14
EXPERIMENT 10

Perform analysis of optimal solution of 2 Phase method Linear


Programming Problem using TORA (software).

15
1
6

You might also like