Algorithm Design Paradigm-2 PDF
Algorithm Design Paradigm-2 PDF
Paradigm - 2
T
C
H
G
P
The Traveling Saleswitch Problem
D 50
20
45 42
T 92
40
54
36
C
32
71 H 58
54
67 36 22
G
P
The Traveling Saleswitch Problem
D 50
20
45 42
T 92
40
54
36
C
32
71 H 58
54
67 36 22
G
Hamilton circuit:
HDTGPCH P
The Traveling Saleswitch Problem
D 50
20
45 42
T 92
40
54
36
C
32
71 H 58
54
67 36 22
G
Hamilton circuit:
HDTPCGH P
The Traveling Saleswitch Problem
D 50
20
45 42
T 92
40
54
36
C
32
71 H 58
54
67 36 22
G
Hamilton circuit:
HCDTPGH P
The Traveling Saleswitch Problem
H P G C D T
Home (H) 0 36 32 54 20 40
Pet store (P) 36 0 22 58 54 67
Greenhous (G) 32 22 0 36 42 71
e
Cleaners (C) 54 58 36 0 50 92
Drugstore (D) 20 54 42 50 0 45
Target (T) 40 67 71 92 45 0
Weight(HDTGPCH) = 20 + 45 + 71 + 22 + 58 + 54 = 270
Possible Hamilton Circuits
H P G C D T
Home (H) 0 36 32 54 20 40
Pet store (P) 36 0 22 58 54 67
Greenhous (G) 32 22 0 36 42 71
e
Cleaners (C) 54 58 36 0 50 92
Drugstore (D) 20 54 42 50 0 45
Target (T) 40 67 71 92 45 0
Weight(HDTGPCH) = 20 + 45 + 71 + 22 + 58 + 54 = 270
Weight(HDTPCGH) = 20 + 45 + 67 + 58 + 36 + 32 = 258
Possible Hamilton Circuits
H P G C D T
Home (H) 0 36 32 54 20 40
Pet store (P) 36 0 22 58 54 67
Greenhous (G) 32 22 0 36 42 71
e
Cleaners (C) 54 58 36 0 50 92
Drugstore (D) 20 54 42 50 0 45
Target (T) 40 67 71 92 45 0
Weight(HDTGPCH) = 20 + 45 + 71 + 22 + 58 + 54 = 270
Weight(HDTPCGH) = 20 + 45 + 67 + 58 + 36 + 32 = 258
Weight(HDTPCGH) = 20 + 45 + 67 + 58 + 36 + 32 = 258
Possible Hamilton Circuits
5! = 5 × 4 × 3 × 2 × 1 = 120