You are here:

C/Travelling Salesman Prob

Advertisement


Question
Hi there!

Im stuck with a program that i have to write in c.
Its the Famous Traveling Salesman problem, better known as the Hamilton circuit.

There are 5 cities.
It is an undirected graph ( distance from A to B is equal to dist form B to A)

The salesman has to visit all the 5 cities only once. I have to help him find the shortest route.

I thought of sloving through bruteforce, that is i try all combinations and the shortest one is the solution...
Confused dont know how to go about it. Graphs! Phew

SOS
Thanking you in advance Sean

Answer
Where is your program and where you are stuck?
First of all, have you understood the concept of the underlying problem?

If yes, have you written down (in plain English) the steps needed to solve this?
You can proceed to coding, only after you complete the above steps. Otherwise, you will not be able to get your program working.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.