Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Data structure - traveling sales person and mesh algorithm
1. DATA STRUCTURE -TRAVELING SALES
PERSON AND MESH ALGORITHM
Presented by
M.Lavanya
M.sc (CS & IT)
Nadar Saraswathi College of arts & science
Theni.
2. INTRODUCTION
• Dynamic programming algorithm for traveling sales person
problem was arrived.
• The worst case complexity of this algorithms will not be any
better than the use of good bounding functions will able this
branch and bound algorithms to solve some problems.
3. TRAVELING SALES PERSON
• Let G = ( V, E) be a directed graph with edge costs Cij. Cij is
defined such that Cy > 0 for all i and j and Cy = co if< i,j > ~
E.
• Let I VI = n and assume n > 1. A tour of G is a directed cycle
that includes every vertex in V.
• The cost of a tour is the sum of the cost of the edges on the
tour. The traveling salesperson problem is to find a tour of
minimum cost.
4. • Every tour consists of an edge < 1, k > for some k E V - { 1}
and a path from vertex k to vertex 1.
• The path from vertex k to vertex 1 goes through each vertex in
V - { 1, k} exactly once.
• It is easy to see that if the tour is optimal then the path from k
to 1 must be a shortest k to 1 path going through all vertices in
V - { 1, k }. Hence, the principle of optimality holds.
5. STATE SPACE TREE FOR THE TRAVELING
SALESPERSON PROBLEM WITH n=4 AND i0=i4=1
6. c(A)={length of tour defined by the path from the root to A , if A is leaf
cost of a minimum-cost leaf in the sub tree A , if A is not a leaf.
• For example: the path defined at node 6 is i0 , i1 , i2 =1 , 2 , 4. It
consists of the edges <1,2> and <2,4>.
• The reduced cost matrix corresponding to G a row or column set to
be reduced iff it contains at least one zero and all remaining entries
are non negative. A matrix is reduced iff every row and column is
reduced.
8. REDUCED COST MATRIX
• Reduced cost matrix with every node in the traveling sales person state
space tree . let A be the reduced cost matrix for node R. let S be a child of R
such the tree edges(R,S).the reduced cost matrix for S may be obtained as
follows:
change all entries in row I and column j of A to ∞.
Set A (j , 1) to ∞.
To reduce rows and columns in the resulting matrix except for rows and
columns containing only ∞.
9. STATE SPACE TREE GENERATED BY
PROCEDURE LCBB
The portion of the states spaces tree that gets generated starting
with the root node as the E-node , nodes 2 , 3 , 4 and 5 are generated.
11. • Reduced matrixes corresponding to the nodes. The matrix of :
Setting all entries in row 1 and column 3 to ∞.
Setting the at position (3,1) to ∞.
Reducing column 1 by subtracting by11.
• A possible organization for the state space is a binary tree in
which a left branch represents the inclusion of a particular edge
yield the right branch represents the exclusion of that edge.
13. GRAPH AND STATE SPACE TREE
• Fig (a) the dynamic binary tree formulation , considered cost
matrix.
• Fig (b) a total of 25 needs to be subtracted from the rows and
columns of this matrix to obtain the reduced matrix. If edge <i,j>
is the left subtree of the root represents all tours including edges
<i,j> and the right subtree represents all tours that not include
edge <i,j>.
• Fig (c) represents the first two level of two possible states space
tree for three vertex graph. Rather then use state space tree , now
a considered a dynamic space tree. This also binary tree.
15. • The root node an edge <i,j> maximize of the right subtree. An
edge <i,j> cost is reduced matrix is positive.
• For edge <1,4> , <2,5> , <3,1> , <3,4> , <4,5> , <5,2> , ∆ = 1 ,
2 , 11 , 0 , 3 , 3 and 11 respectively.
• The edges <3,1> or <5,3> can be used. The selects the edge
<3,1> can be computed the state space tree.
17. MESH ALGORITHM
Computational Model:
• A mesh is a x b grid there is a processor at each grid
pointer. The edges is to communication links and
bidirectional .
• Each processor can labeled with tuple (i,j) where 1 ≤ i ≤ a
and 1 ≤ j ≤ b.
• Every processor of the mesh is a RAM with local
memory.
18. • The basic operations such as addition , subtraction ,
multiplication , comparison , local memory access and so on ,
in 1 unit time.
• This computation is to be synchronous ; that is , there is a
global clock and in every time unit each processor completes it
tasks.
19. MESH – CONNECTED COMPUTER
A considered only square meshes , that is , meshes for which a=b.
A √p X √p mesh
20. LINEAR ARRAY
• A linear array consist of be processor (named 1,2,…….,p)
• The processor 1 is connected to processor 2 and processor p is
connected to processor p-1
• processors 1 and p are known as the boundary processors.
Processor i-1(i+1) is called left neighbor(right neighbor) of i.
21. • In a mesh, all processor first(second) coordinates are the same
form a row (column) of the mesh . For eg row i is made up of
the processors(i,1) , (i,2) ,….,(i, √p).
• Each row or column is a √p- processor linear array . a mesh
algorithm consists of steps that are local to individual rows or
columns.