Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

Solve.pdf BRAC University CSE 422

Beoordeling
-
Verkocht
-
Pagina's
9
Cijfer
A+
Geüpload op
20-07-2023
Geschreven in
2022/2023

CSE422: Artificial Intelligence Assignment 2 Genetic Algorithm Question 1: Object Profit Weight A 7 3 B 3 2 C 12 6 D 5 8 E 4 5 F 16 1 G 20 4 Maximum weight = 20 The above problem is a 0/1 Knapsack problem. Here there are 7 different objects labelled from A to G. The objective of this problem is to carry the different objects in your bag in such a way such that the profit is maximized. But you have to make sure that your bag does not exceed the maximum weight i.e. the maximum weight that this bag can carry is less than or equal to 15. Remember you can carry an object exactly once. Now it is your job to use Genetic Algorithm to solve this problem. This study source was downloaded by from CourseH on :19:19 GMT -05:00 1. Encode the problem and create an initial population of 4 different chromosomes (2 marks) Answer: Firstly, we will create random populations on the basis of the object taken. If taken we will put 1 otherwise 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 0 1 0 0 1 1 1 1 0 1 0 1 1 2. Think of an appropriate fitness function to this problem and give proper justification. (2 marks) Here, as a fitness function we will collaborate on profit and weight. Firstly we will calculate the sum of profits and the sum of weights. If sum of weight = maximum weight, return fitness= (sum of profits)

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

CSE422: Artificial Intelligence
Assignment 2
Genetic Algorithm

Question 1:
Object Profit Weight

A 7 3

B 3 2

C 12 6

D 5 8

E 4 5

F 16 1

G 20 4



Maximum weight = 20
The above problem is a 0/1 Knapsack problem. Here there are 7 different objects labelled from A
to G. The objective of this problem is to carry the different objects in your bag in such a way
such that the profit is maximized. But you have to make sure that your bag does not exceed the
maximum weight i.e. the maximum weight that this bag can carry is less than or equal to 15.
Remember you can carry an object exactly once. Now it is your job to use Genetic Algorithm to
solve this problem.




This study source was downloaded by 100000853497421 from CourseHero.com on 07-20-2023 01:19:19 GMT -05:00


https://www.coursehero.com/file/103965724/Solvepdf/

, 1. Encode the problem and create an initial population of 4 different chromosomes (2
marks)


Answer:


Firstly, we will create random populations on the basis of the object taken. If taken we will
put 1 otherwise 0
1 0 0 0 1 1 1




1 0 0 1 1 0 1




1 0 1 0 0 1 1




1 1 0 1 0 1 1



2. Think of an appropriate fitness function to this problem and give proper justification. (2
marks)


Here, as a fitness function we will collaborate on profit and weight. Firstly we will calculate
the sum of profits and the sum of weights.
If sum of weight <= maximum weight, return fitness= (sum of profits)


Else return fitness=0




This study source was downloaded by 100000853497421 from CourseHero.com on 07-20-2023 01:19:19 GMT -05:00


https://www.coursehero.com/file/103965724/Solvepdf/

Geschreven voor

Vak

Documentinformatie

Geüpload op
20 juli 2023
Aantal pagina's
9
Geschreven in
2022/2023
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$8.99
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
FaiFai

Maak kennis met de verkoper

Seller avatar
FaiFai Harvard College
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
4
Lid sinds
3 jaar
Aantal volgers
2
Documenten
145
Laatst verkocht
1 jaar geleden

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen