|
|
back to boardplease help me.. Posted by double 5 Feb 2008 11:36 I don't know how to print. I used floyd. And who can tell me how to print the route? 3X. Edited by author 05.02.2008 11:38 Re: please help me.. Posted by Javran 5 Jul 2009 16:27 I used floyd but I don't know how to print the path out Waiting for help,,... +_+ ... Re: please help me.. 1)you should write recursive function which builds the shortest way 2) suppose you want to build path between i and j cities. what's the next city after the i-city? To answer this question you loop all i-th neighbors and choose some neighbor k where weight[i][k]+distance[k][j]->min, 3) suppose you want to build path between k and j cities. what's the next city after the k-city? (recursively repeat it!) |
|
|