Branch and Bound Implementations for the Traveling Salesperson Problem

3
 Branch and Bound Implementations for the Traveling Salesperson Problem  What is TSP?  Given a list of cities and the distances between each pair of cities, find the shortest possible route that visits each city exactly once and returns to the original city. Applictions The TSP naturally arises as a subproblem in many transportation and logistics applications. Scheduling of a machine to drill holes in a circuit board or other object. In this case the holes to be drilled are the cities, and the cost of travel is the time it takes to move the drill head from one hole to the next. Program #include<stdio.h> #include<conio.h> #include<stdlib.h> int a[10][10],visited[10],n,cost=0;  void get() { int i,j; printf("--------------------------------------------------------------------- -\n"); printf("-------------------made by C code champ ----------------------------- -\n"); printf("--------------------------------------------------------------------- -\n"); printf("\n\n\t TRAVELLING SALESMAN PROBLEM SOLUTION IN C\n");  printf("\n\nEnter Number of Cities: ");  scanf("%d",&n); printf("\nEnter Cost Matrix: \n");  for( i=0;i<n;i++)  

description

Branch and Bound TSP Program

Transcript of Branch and Bound Implementations for the Traveling Salesperson Problem

Branch and Bound Implementations for the Traveling Salesperson Problem What is TSP? Given a list of cities and the distances between each pair of cities, find the shortest possible route that visits each city exactly once and returns to the original city.

ApplictionsThe TSP naturally arises as a subproblem in many transportation and logistics applications. Scheduling of a machine to drill holes in a circuit board or other object. In this case the holes to be drilled are the cities, and the cost of travel is the time it takes to move the drill head from one hole to the next.

Program

#include

#include

#include

inta[10][10],visited[10],n,cost=0;

voidget()

{

inti,j;

printf("----------------------------------------------------------------------\n");

printf("-------------------made by C code champ ------------------------------\n");

printf("----------------------------------------------------------------------\n");

printf("\n\n\t TRAVELLING SALESMAN PROBLEM SOLUTION IN C\n");

printf("\n\nEnter Number of Cities: ");

scanf("%d",&n);

printf("\nEnter Cost Matrix: \n");

for( i=0;i