Traveling Salesman Problem

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

Traveling Salesman Problem

Presented By : Pooja kapoor

Traveling Salesman Problem


The TSP involves finding the minimum traveling cost for visiting a fixed set of customers. The vehicle must visit each customer exactly once and return to its point of origin also called depot. The objective function is the total cost of the tour.

Given
A directed graph G = (V,E)

Edge costs cij s.t cij >0

Finding a Solution
There are a few general methods for finding solutions for the TSP: Brute Force Dynamic Programming Approximation

Dynamic Programming
It is an algorithm design method that can used when the solution to a problem can be viewed as

the result of a sequence of decisions.

From the principle of optimality :


g(1,V-{1})= min{ck+ g(k,V-{1,k})} (1) Generalizing eq(1),we have g(i, S) = min{cj+ g(j,S-{j})}..(2)

Contd
Clearly, g(i, )= c , 1 i n

So we can find all values of g(i, S) for all S of size 1. Then we find g(i,S) for S with |S|=2 and so on,

Example
0 10 15 5 0 9 6 13 0 8 8 9 20 10 12 0

g(2,) = c = 5 g(3,) = c = 6 g(4,) = c = 8

0 5 6 8

10 15 20 0 9 10 13 0 12 8 9 0

g(2,{3}) = c + g( 3,) =15 g(2,{4}) = 18 g(3,{2}) = 18 g(3,{4}) = 20 g(4,{2}) = 13 g(4,{3}) = 15

0 5 6 8

10 15 20 0 9 10 13 0 12 8 9 0

Next , we compute g(i, S) with |S|=2 where i 1, 1 S, i S

g(2,{3,4}) = min{c + g(3,{4}),c + g(4,{3})} = min{29,25} =25 g(3,{2,4}) = min{c + g(2,{4}),c + g(4,{2})} =25 g(4,{2,3}) = min{c + g(2,{3}),c + g(3,{2})} =23

0 5 6 8

10 15 20 0 9 10 13 0 12 8 9 0

Finally, we have g(1,{2,3,4})=min{c +g(2,{3,4}), c+g(3,{2,4}), c+g(4,{2,3})} = min{35,40,43} = 35

Result
Minimum cost = 35 Optimal tour is 1-2-4-3-1

Applications

Transportation

School Bus Routes Traveling Salesman Microchip Manufacturing Network Engineering

Technology

THANK YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy