You are on page 1of 4

D

NAMA : JEREMY TOMBILING


NIM : 220211010083

Please add the profit in the Knapsack problem with the last digit of your student ID, in case of the
last digit is 0, please add it with 10. Afterwards, please conduct the greedy algorithm procedure
and also using solver.

m 15

P 10 5 15 7 6 18 3
W 2 3 5 7 1 4 1

Setiap Profit + Nim akhir =

NIM akhir 8

m 15

P 12 7 17 9 8 20 5
W 2 3 5 7 1 4 1
X 1 0.666667 1 0 1 1 1

constraint 15

objective 66.66667
Please add the distance in the Travel Salesman Problem with the last digit of your student ID as in
previous task and carry out the Hill Climbing algorithm for both Simple and Steepest Ascent Hill
Climbing.
NIM = 2 = +2 for the distance
7.3
A B
9 6.8
7 5.5

C D
2.9

Simple Hill Climbing

Steps
• Develop the problem dynamic tree
• Operator used is the operator with different cities combination, i.e. by swapping the sequence of
cities visited

= 6 operator combination

a) Swap 1, 2
b) Swap 2, 3
c) Swap 3, 4
d) Swap 4, 1
e) Swap 2, 4
f) Swap 1, 3
• Next the search starts from the most left
ABCD (17)

S1,2 S2,3 S3,4 S4,1 S2,4 S1,3


BACD (17.2) ACBD (19.3) ABDC (15.7) DBCA ADCB CBAD

S1,2 S2,3 S3,4 S4,1 S2,4 S1,3


BADC (19.2) ADBC (21.3) ABCD (17) CBDA (21.3) ACDB (15.4) DBAC

S1,2 S2,3 S3,4 S4,1 S2,4 S1,3


CADB (21.5) ADCB (18.7) ACBD (19.3) BCDA (18.7) ABDC (15.7) DCAB (17.2)

Jadi, rute paling optimal adalah dari A → C → D → B dengan jarak 15.4

Steepest Ascent Hill Climbing


In the Steepest Ascent Hill Climbing method, instead of finding the first better heuristic value, the
search was continued to find the best heuristic value from all state possible.

ABCD (17)

S1,2 S2,3 S3,4 S4,1 S2,4 S1,3


BACD ACBD ABDC DBCA ADCB CBAD
(17.2) (19.3) (15.7) (19.3) (18.7) (23.1)

S1,2 S2,3 S3,4 S4,1 S2,4 S1,3


BADC (19.2) ADBC (21.3) ABCD (17) CBDA (21.3) ACDB (15.4) DBAC

S1,2 S2,3 S3,4 S4,1 S2,4 S1,3


CADB (21.5) ADCB (18.7) ACBD (19.3) BCDA (18.7) ABDC (15.7) DCAB (17.2)

You might also like