0% found this document useful (0 votes)
26 views9 pages

Coach Problem or Shortest - Path Problem or Traveling Salesman Problem

To find the shortest distance and the corresponding path from a given source node to given destination node.

Uploaded by

soorajyadav9698
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views9 pages

Coach Problem or Shortest - Path Problem or Traveling Salesman Problem

To find the shortest distance and the corresponding path from a given source node to given destination node.

Uploaded by

soorajyadav9698
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Model-1

Stage -coach problem or shortest -path problem or traveling salesman problem

Objective:- To find the shortest distance and the corresponding path from a given source node to
given destination node.

Solution:- to solve the shortest -path problem first we need to define problem stage , decision
variables , state variables return function , transition function.
Decision variables(dn):- these are the variables that define the immediate destination when there are ‘n’ stages to
go.

State variables(Sn):-these variables describe the specific city at any stages.

Return function(Fn(Sn,dn):-this function calculates the minimum total distance for the last ‘n’ stages.

Transition function:- this function define how the state varibles changes as the problems progresses from one
stages to another.

Minimum distance (F*n(Sn)):-optimal path (minimum distance) when the salesman is in state Sn with n more
stages to go for reaching the final stage(destination)
To solve this problem we start calculating distance between a pair of cities from destination city and work backwards
to find the optimal path.
The recursion relationship for this problem can be stated as follows
Example:-
We are follow something called as backword recursive approach.

n=1 one more stage to go


Now move backword to stage 2,we have three states s1=8,s1=9
Here we have only one decision variable d1=10

States(s1) F1(s1,d1)=Ds1,d1(d1=10) Minimum distance(f*1(s1)) Optimal decision(d1)

8 7 7 10

9 9 9 10
n=2 two more stage to go
Now move backword to stage 3,we have three states s2=5,s2=6,s2=7
Here we have two decision variable d2=8,d2=9
For this we have to evaluates two sums:
D(5,8 )+f*1(8)=4+7=11
D(5,9) +f*1(9)=8+9=17
Take minimum of two
F2(5)=Min{11,17}=11.
Similarly for s2=6,s2=7
F2(6)=Min{D(6,8)+f*1(8)=3+7=10,D(6,9)+f*1(9)=7+9=16}=10
F2(7)=Min{D(7,8)+f*1(8)=8+7=15,D(7,9)+f*1(9)=4+9=13}=13
States(s2) F2(s2,d2)=Ds2,d2(d2=8) F2(s2,d2)=Ds2,d2(d2=8) Minimum distance(f*2(s2)) Optimal decision(d2)

5 11 17 11 8

6 10 16 10 8

7 15 13 13 9
n=3 three more stage to go

Now move backword to stage 4,we have three states s3=2,s2=3,s2=4


Here we have three decision variable d3=5,d3=6,d3=7
F3(2)=Min{D(2,5)+f*2(5)=7+11=18,D(2,6)+f*2(6)=10+10=20,D(2,7)+f*2(7)=5+13=18}=18
F3(3)=Min{D(3,5)+f*2(5)=3+11=14,D(3,6)+f*2(6)=8+10=18,D(3,7)+f*2(7)=4+13=17}=14
F3(4)=Min{D(4,5)+f*2(5)=6+11=17,D(4,6)+f*2(6)=10+10=20,D(4,7)+f*2(7)=5+13=18}=17

States(s3) F3(s3,d3)=Ds3,d3(d3=5) F3(s3,d3)=Ds3,d3(d3=6) F3(s3,d3)=Ds3,d3(d3=7) Minimum distance(f*3(s3)) Optimal decision(d3)

2 18 20 18 18 5 or 7

3 14 18 17 14 5

4 17 20 18 17 5
n=4 four more stage to go

Now move backword to stage 5,we have one states s4=1


Here we have three decision variable d4=2,d4=3,d4=4
F4= Min{D(1,2)+f*3(2)=4+18=22,D(1,3)+f*3(3)=6+14=20,D(1,4)+f*3(4)=3+17=20}=20

States(s4) F4(s4,d4)=Ds4,d4(d4=2) F4(s4,d4)=Ds4,d4(d4=3) F4(s4,d4)=Ds4,d4(d4=4) Minimum Optimal decision(d3)


distance

1 22 20 20 20 3 or 4

From the above, it is clear that there are two{(1,3,5,8,10) or (1,4,5,8,10)} alternative shortest routes for this problem,
both having a minimum distance of 20.

You might also like