15-11-2012, 04:22 PM
Branch and bound algorithm for traveling salesperson problem
Branch and bound algorithm for traveling salesperson problem.docx (Size: 13.98 KB / Downloads: 25)
Coding:
#include<stdio.h>
#include<conio.h>
#include<alloc.h>
int n;
int a[10][10],list[20],bpath[20];
int i,j,bcost,tbcost;
void get();
void initialize();
void calc(int list[]);
void swap(int x,int y);
void perm(int,int);
void display();
void get()
{
printf("Enter the number of cities ::");
scanf("%d",&n);
for(i=0;i<n;i++)
for(j=0;j<n;j++)