Need help with solving my problem with JGAP

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Need help with solving my problem with JGAP

Ashish Kulkarni-2
Hi
I need to find the optimal path between some points, i know the total time between each combination
Suppose i have points A B C D E F G H
and i know the distance between
A-B
A-C
A-D
B-A
B-C
B-D
etc, for all the points, now i want to find the fastest route if i have to go from A to H or B - D
So i know my starting point and my ending point, and i want to find the optimal path between them.

But i am having problem solving it, as the solution i get starts with the starting point but ends with a different point all the time, what am i missing or did wrong

I am attaching 3 java source files along this mail, you can download and complile them with JGAP 3.2.2 in classpath.
I have also attached jar file with source and classes so you can run it directly

GetFromToValue.java creates the sample data for from to values
TestSalesManSolution.java creates the solutions and returns getOptimizedList the optimal array as answer
TestSolutions.java calles TestSalesManSolution 2 times passing the Array of places.

If you can help me understand what i am missing would be a real help

Ashish


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
jgap-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgap-users

GetFromToValue.java (1K) Download Attachment
TestSalesManSolution.java (2K) Download Attachment
TestSolutions.java (2K) Download Attachment
testp.jar (8K) Download Attachment