Download - Traveling Salesman Problem.ppt

Transcript
  • 7/27/2019 Traveling Salesman Problem.ppt

    1/24

    Traveling Salesman Problem

  • 7/27/2019 Traveling Salesman Problem.ppt

    2/24

    TSP

    The goal is, to find the most economical way for a

    select number of cities with the following

    restrictions:

    - Must visit each city once and only once

    - Must return to the original starting point

  • 7/27/2019 Traveling Salesman Problem.ppt

    3/24

    BASICS

    Complete Graph vertices joined by a single edge

    Weighted Graph edges carry a value

    Hamiltonian Circuit - connects all points on a graph, passes

    through each point only once, returns to origin

    Hamiltonian Path - A route not returning to the beginning

  • 7/27/2019 Traveling Salesman Problem.ppt

    4/24

    Finding an Approximate Solution

    Cheapest Link Algorithm

    Edge with smallest weight is drawn first

    Edge with second smallest weight is drawn in

    Continue unless it closes a smaller circuit or three

    edges come out of one vertex

    Finished once a complete Hamilton Circuit is drawn

  • 7/27/2019 Traveling Salesman Problem.ppt

    5/24

    Cheapest Link Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    6/24

    Cheapest Link Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    7/24

    Cheapest Link Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    8/24

    Cheapest Link Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    9/24

    Cheapest Link Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    10/24

    Finding an Approximate Solution

    Nearest Neighbor Algorithm

    Start at any given vertex

    Travel to edge that yields smallest weight and has not

    been traveled through yet

    Continue until we have a complete Hamilton circuit

  • 7/27/2019 Traveling Salesman Problem.ppt

    11/24

    Nearest Neighbor Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    12/24

    Nearest Neighbor Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    13/24

    Nearest Neighbor Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    14/24

    Nearest Neighbor Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    15/24

    Nearest Neighbor Algorithm

  • 7/27/2019 Traveling Salesman Problem.ppt

    16/24

    Comparing Approximating Methods

    Cheapest Link Nearest Neighbor

    Total weight for

    Cheapest Link 31

    Nearest Neighbor 33

  • 7/27/2019 Traveling Salesman Problem.ppt

    17/24

    17

    A 42-City Problem (The Nearest Neighbour Method)

    (Starting at City 1)

    1

    21

    20

    19

    29

    7

    30

    28

    3137

    3236

    11

    9

    34

    10

    39

    38

    35

    12

    33

    8

    2726

    624

    25

    14

    1523

    22

    213

    16

    3

    17 4

    18

    42

    40

    41

    5

  • 7/27/2019 Traveling Salesman Problem.ppt

    18/24

    18

    The Nearest Neighbour Method (Starting at City 1)

    1

    21

    20

    19

    29

    7

    30

    28

    3137

    3236

    11

    9

    34

    10

    39

    38

    35

    12

    33

    8

    2726

    624

    25

    14

    1523

    22

    213

    16

    3

    17 4

    18

    42

    40

    41

    5

  • 7/27/2019 Traveling Salesman Problem.ppt

    19/24

    19

    The Nearest Neighbour Method (Starting at City 1)

    Length 1498

    1

    21

    20

    19

    29

    7

    30

    28

    3137

    3236

    11

    9

    34

    10

    39

    38

    35

    12

    33

    8

    2726

    624

    25

    14

    1523

    22

    213

    16

    3

    17 4

    18

    42

    40

    41

    5

  • 7/27/2019 Traveling Salesman Problem.ppt

    20/24

    20

    29

    Remove Crossovers

    1

    21

    20

    19

    7

    30

    28

    31 37

    32 36

    11

    9

    34

    10

    39

    38

    35

    12

    33

    8

    2726

    624

    25

    14

    15 23

    22

    213

    16

    317 4

    18

    42

    40

    41

    5

  • 7/27/2019 Traveling Salesman Problem.ppt

    21/24

    21

    Remove Crossovers

    1

    21

    20

    19

    29

    7

    30

    28

    31 37

    32 36

    11

    9

    34

    10

    39

    38

    35

    12

    33

    8

    2726

    624

    25

    14

    15 23

    22

    213

    16

    317 4

    18

    42

    40

    41

    5

  • 7/27/2019 Traveling Salesman Problem.ppt

    22/24

    22

    Remove Crossovers Length 1453

    1

    21

    20

    19

    29

    7

    30

    28

    31 37

    32 36

    11

    9

    34

    10

    39

    38

    35

    12

    33

    8

    2726

    624

    25

    14

    15 23

    22

    213

    16

    317 4

    18

    42

    40

    41

    5

  • 7/27/2019 Traveling Salesman Problem.ppt

    23/24

    Applications of the TSP

    Computer Wiring - connecting together computer

    components using minimum

    wire length

    Archaeological Seriation - ordering sites in time

    Genome Sequencing - arranging DNA fragments in

    sequence

    Planning, logistics, and the manufacture of microchips

  • 7/27/2019 Traveling Salesman Problem.ppt

    24/24

    THANK YOU