Re: TSP and Minimum Weighted Route Programming Computer Science by Nikhar … saying that triangular inequality should hold in TSP... that is a specialization of TSP - the metric TSP. All I'm saying (or rather… truck must take so as to travel minimum distance' and TSP is one and the same. TSP and Minimum Weighted Route Programming Computer Science by Nikhar … I've done on the problem so far. Since the TSP states that each vertex has to be visited exactly once…, for the problem stated to be an instance of TSP, G(V,E) must be a complete graph. Otherwise, it… until now is correct, can I say the follwing? For TSP to be similar to the minimum weight route problem stated… Re: TSP and Minimum Weighted Route Programming Computer Science by Momerath Triangular inequality doesn't have to hold for a graph, nor for the TSP problem. Consider a situation where the route from AD is not direct, but wanders around the countryside. Re: TSP and Minimum Weighted Route Programming Computer Science by Taywin Your problem is not about TSP. You could read this [post](http://cstheory.stackexchange.com/questions/7606/need-an-efficient-algorithm-to-visit-all-nodes-of-a-graph-revisiting-edges-and) from other site about how to solve your problem. Re: TSP and Minimum Weighted Route Programming Computer Science by Momerath I agree with Taywin. The problem is TSP, having the nodes satisfy TI just makes the graphs a subset of all graphs, but doesn't change the problem. TSP - dynamic programming Programming Software Development by DawnofanewEra Why are some algorithm to solve TSP using dynamic programming can solve up to 10 cities while some can go beyond that...i.e. 10, 100 or more..!! What is the factor that determines the capability of the algortihm to solve more than 10 or less..?? Re: TSP - dynamic programming Programming Software Development by kal_crazy …'s algorithm. In my opinion the best way to solve TSP is by Simulated Annealing. This works by comparing the current… TSP to VRP Programming Software Development by Nghia_1 Hi everyone,it's my program about using tabu search to solve TSP in C# and my professor want improve it to solve VRP. Someone help me. https://www.mediafire.com/?3j21h8ac5bfjxg4 Difference between s/mime ,tsp and pgp? Programming Software Development by AS_82 What is the difference between s/mime ,tsp and pgp? Reference :encoding type in Bouncy Castle.org , jar download Re: TSP and Minimum Weighted Route Programming Computer Science by Taywin Yes, you are correct. But that doesn't mean it will help you solve your problem. As you said, if there is a path from D->...->u->v->...->B and then you found that it is shorter to go from A->D rather than A->B->D, it still doesn't help you because you will eliminate the path to visit vertex B. As a result, it is not a … Re: TSP - dynamic programming Programming Software Development by DawnofanewEra I was wondering why my program (dynamic programming) cannot compute more than 5 cities. #include <iostream> #include <stdlib.h> #include <ctime> #include <stdio.h> #include <time.h> #include <unistd.h> #include <iomanip> #include <sys/time.h> #define … Re: TSP - dynamic programming Programming Software Development by Moschops You have hard-coded the size of your arrays: `int c[5][5],d[24],p[24][6],list[5],r;` If you need arrays that can have their size set at runtime, don't use arrays. Use C++ std::vector (or the shiny new std::array if your compiler supports it) to get arrays that you can set the size of at runtime. Re: TSP - dynamic programming Programming Software Development by tinstaafl Also you have a constant `NUM_CITIES` set to 5 Re: A* Search - TSP Programming Software Development by Taywin … data structure for the problem are going to be. The TSP problem itself is not too difficult to understand. You, however… TSP read input file problem Programming Software Development by sycc2172 Greetings. I'm currently doing a project on Traveling Salesman Problem. But I'm not asking for answers for the whole project. I just started my programming lessons so I hope can get some help from all of you. About this project: Initially you have to read 2 input files, Input1.txt and Input2.txt. An example of the contents for these 2 input … Re: TSP read input file problem Programming Software Development by iamthwee Is the text file in the same directory as your program? Re: TSP read input file problem Programming Software Development by sycc2172 Yes it is.. I put it into the Debug folder. The file name is exactly the same Re: TSP read input file problem Programming Software Development by iamthwee Can you try dumping your text file in the c: drive then change your program so this line:[B]inStream.open("Sarawak_Cnx.txt"); [/B] becomes: [b]inStream.open("[COLOR=red]C:\\[/COLOR]Sarawak_Cnx.txt"); [/b] What happens now? Re: TSP read input file problem Programming Software Development by sycc2172 Argh... I got it! I put into the wrong directory. Thanks for the advice. One question. Is the code above able to change to using pointer instead of arrays? Re: TSP read input file problem Programming Software Development by iamthwee Um no using an array and indexing should be easier to understand than pointers and is perfectly ok. I'd stick with that. Just to let you know the way you are reading in data from a file is wrong and horribly flawed. Shall I show you the correct way. Re: TSP read input file problem Programming Software Development by sycc2172 Yes please. I'm just a new student taking C++ lesson this semester. Any advice would be much appreciated Re: TSP read input file problem Programming Software Development by iamthwee Oops sorrie I gotta go. :( Re: TSP read input file problem Programming Software Development by sycc2172 Okay.. nvm.. Thx for the help. :) I'll proceed with the code... Re: TSP read input file problem Programming Software Development by iamthwee Yeah basically you wanna use something like [code] #include <iostream> //basic i/o #include <fstream> //file input out #include <string> //string handling using namespace std; int main() { //open a file for reading ifstream read ("foo.txt"); string chunk; //this will be the string which holds each word or number… TSP: creating an initial population of tours Programming Software Development by Pavan_5 I am trying to develop the genetic algorithm to solve Traveling Saleman problem and part of my challenge is to generate random tours long enough and write a fitness function to evaluate the cost incurred for each of the random tour. I have attempted to write the following. My objective is to generate random tours from the city to city distance … Re: TSP: creating an initial population of tours Programming Software Development by JamesCherrill Realistically, I doubt that anyone is going to spend any time trying to understand undocumented unindented code with meaningless variable names. Maybe you could make it a bit easier? Re: TSP: creating an initial population of tours Programming Software Development by Tarek_2 I'm not sure I understand what you want to do here (first of all, the code is not readable"), but what I know, your "perm" array is not a matrix. Re: TSP: creating an initial population of tours Programming Software Development by Pavan_5 I am unable to modify the code. I am trying to . There is no "Edit Post" button in my question page. anyways I did manage to write better code. imagine the matrix is city to city distance and I am trying to generate random tours where each tour starts and ends at same city and visits all nodes atleast and exactly once. public class … Re: TSP: creating an initial population of tours Programming Software Development by JamesCherrill That really is a whole lot better. So now what exactly is the problem or question? ps: Edit button behaviour is standard - you only have limited time to edit a post before people start responding. If there's some change that's really important (eg delete personal info posted by mistake) you can ask a moderator for help. Re: TSP: creating an initial population of tours Programming Software Development by Pavan_5 Dear JamesCherill, My program above is expected to produce an output of random tours. http://en.wikipedia.org/wiki/Tournament_(graph_theory) see the above is basically a 5 city network where distance between each city is provided as a "city-to-city distance" matrix. I need to find a shortest way to start from a city (could be any city), …