15,792,959 members
Home / Discussions / Java

# Java

 Re: How to put the condition if the array may be empty? Richard MacCutchan26-Nov-22 4:04 Richard MacCutchan 26-Nov-22 4:04
 Re: How to put the condition if the array may be empty? Cris29M26-Nov-22 4:43 Cris29M 26-Nov-22 4:43
 Re: How to put the condition if the array may be empty? Richard MacCutchan26-Nov-22 5:41 Richard MacCutchan 26-Nov-22 5:41
 Re: How to put the condition if the array may be empty? Cris29M26-Nov-22 5:53 Cris29M 26-Nov-22 5:53
 Address Book System Help Ghost 717-Nov-22 20:19 Ghost 7 17-Nov-22 20:19
 Re: Address Book System Help Richard MacCutchan17-Nov-22 21:38 Richard MacCutchan 17-Nov-22 21:38
 Re: Address Book System Help CHill6018-Nov-22 1:02 CHill60 18-Nov-22 1:02
 Travel Salesman Problem find itinerary with highest visited sites attractiveness score Faroug Tifratene16-Nov-22 1:36 Faroug Tifratene 16-Nov-22 1:36
 i am trying develop an algorithm to solve a Travelling Salesman Problem similar case where the goal is to find the best route with the highest attractiveness score (sum of scores for all visited sites/nodes) within a fixed time frame. to illustrate this more: a tourist wants to visit N attraction sites in a city and he only has 8 hours to visit as many attraction sites as possible. every site has an attractiveness score and the time spent to visit it. example: - site A with ID 0 has an attractiveness score of 90 and requires 10 minutes to visit it ([0, 90, 10]) - site B with ID 1 has an attractiveness score of 69 and requires 7 minutes to visit it ([1, 69, 7]) - site C with ID 2 has an attractiveness score of 72 and requires 7 minutes to visit it ([2, 72, 11]) - site D with ID 3 has an attractiveness score of 116 and requires 16 minutes to visit it ([3, 116, 16]) . . . and so on. Now we have a time matrix T where T[i][j] represents the necessary time to go from site i to site j. finally we consider site 0 as both the start site and the end site, i.e. the tourist starts his journey at site 0 and returns to site 0 (a hotel for instance). so the task is to find an itinerary for the tourist to visit as many attractions as possible with a maximum sum score of attractiveness. example of T matrix for sites A,B,C and D (it could be 50 sites): T = [0, 40, 35, 90] [30, 0, 25, 130] [67, 83, 0, 75] [45, 79, 130, 0] The TSP has been solved using different algorithms or methods but i am stuck with this one as it's a little bit different in the sense that the goal is to find the maximum attractiveness score for an itinerary within a time frame, and not the shortest route. your help is much appreciated I thought of methods like greedy algorithm, dynamic programming used in TSP but couldn't find a way to solve this particular problem.
 JavaFX ScrollPane scroll child to bottom MVSoftVM14-Nov-22 7:30 MVSoftVM 14-Nov-22 7:30
 Re: JavaFX ScrollPane scroll child to bottom englebart19-Nov-22 16:53 englebart 19-Nov-22 16:53
 Error while fetching Path locally during unit testing but not at runtime saurabh jasmeen mehta12-Nov-22 20:44 saurabh jasmeen mehta 12-Nov-22 20:44
 Re: Error while fetching Path locally during unit testing but not at runtime Richard MacCutchan12-Nov-22 22:15 Richard MacCutchan 12-Nov-22 22:15
 Re: Error while fetching Path locally during unit testing but not at runtime jschell14-Nov-22 7:36 jschell 14-Nov-22 7:36
 radiusofcircle Halima Kidiwala9-Nov-22 18:03 Halima Kidiwala 9-Nov-22 18:03
 Re: radiusofcircle Richard MacCutchan9-Nov-22 23:00 Richard MacCutchan 9-Nov-22 23:00
 check and correct the following code EngySamy23-Oct-22 15:40 EngySamy 23-Oct-22 15:40
 Re: check and correct the following code Richard MacCutchan23-Oct-22 22:50 Richard MacCutchan 23-Oct-22 22:50
 Re: check and correct the following code EngySamy23-Oct-22 23:55 EngySamy 23-Oct-22 23:55
 Re: check and correct the following code Richard MacCutchan24-Oct-22 0:24 Richard MacCutchan 24-Oct-22 0:24
 Re: check and correct the following code Dave Kreskowiak24-Oct-22 3:30 Dave Kreskowiak 24-Oct-22 3:30
 Re: check and correct the following code Richard MacCutchan24-Oct-22 4:26 Richard MacCutchan 24-Oct-22 4:26
 Re: check and correct the following code jschell24-Oct-22 15:03 jschell 24-Oct-22 15:03