1. Find Solution of Travelling salesman problem using nearest neighbor method
Work\Job | 1 | 2 | 3 | 4 |
1 | x | 4 | 9 | 5 |
2 | 6 | x | 4 | 8 |
3 | 9 | 4 | x | 9 |
4 | 5 | 8 | 9 | x |
Solution:
The number of rows = 4 and columns = 4
| `1` | `2` | `3` | `4` | |
`1` | M | 4 | 9 | 5 | |
`2` | 6 | M | 4 | 8 | |
`3` | 9 | 4 | M | 9 | |
`4` | 5 | 8 | 9 | M | |
| | | | | |
1. If we start from 1, then path is
`1->2=4,``2->3=4,``3->4=9,``4->1=5`
and total distance = 22
2. If we start from 2, then path is
`2->3=4,``3->1=9,``1->4=5,``4->2=8`
and total distance = 26
3. If we start from 3, then path is
`3->2=4,``2->1=6,``1->4=5,``4->3=9`
and total distance = 24
4. If we start from 4, then path is
`4->1=5,``1->2=4,``2->3=4,``3->4=9`
and total distance = 22
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then