Click here to Skip to main content
15,867,308 members
Home / Discussions / Java
   

Java

 
QuestionHow to found a file by utilizing a variable for 'Startswith' in JAVA? Pin
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 0:32
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 0:32 
AnswerRe: How to found a file by utilizing a variable for 'Startswith' in JAVA? Pin
Richard MacCutchan3-Jan-23 1:22
mveRichard MacCutchan3-Jan-23 1:22 
Questionhow to discover a file by utilizing a variable for 'Startswith' in java? Pin
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 0:22
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 0:22 
AnswerRe: how to discover a file by utilizing a variable for 'Startswith' in java? Pin
Richard MacCutchan3-Jan-23 0:25
mveRichard MacCutchan3-Jan-23 0:25 
GeneralRe: how to discover a file by utilizing a variable for 'Startswith' in java? Pin
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 1:11
MOHAMMAD ZAINUL ABIDEEN3-Jan-23 1:11 
QuestionDisplay BLOB image in JSP Pin
simoneguidi0130-Dec-22 5:09
simoneguidi0130-Dec-22 5:09 
AnswerRe: Display BLOB image in JSP Pin
jschell2-Jan-23 13:29
jschell2-Jan-23 13:29 
QuestionWhich coding language is best for developing web apps? Pin
nithin sethu14-Dec-22 2:18
nithin sethu14-Dec-22 2:18 
AnswerRe: Which coding language is best for developing web apps? Pin
Richard MacCutchan14-Dec-22 2:41
mveRichard MacCutchan14-Dec-22 2:41 
GeneralRe: Which coding language is best for developing web apps? Pin
Richard Deeming14-Dec-22 2:48
mveRichard Deeming14-Dec-22 2:48 
GeneralRe: Which coding language is best for developing web apps? Pin
Richard MacCutchan14-Dec-22 2:58
mveRichard MacCutchan14-Dec-22 2:58 
AnswerRe: Which coding language is best for developing web apps? Pin
Gerry Schmitz14-Dec-22 9:10
mveGerry Schmitz14-Dec-22 9:10 
QuestionPor favor alguien q me ayude con estos ejercicios en netbenas en formulario jframe Pin
Joel Jordan3-Dec-22 13:00
Joel Jordan3-Dec-22 13:00 
AnswerRe: Por favor alguien q me ayude con estos ejercicios en netbenas en formulario jframe Pin
PIEBALDconsult3-Dec-22 13:16
mvePIEBALDconsult3-Dec-22 13:16 
QuestionHow to put the condition if the array may be empty? Pin
Cris29M26-Nov-22 2:37
Cris29M26-Nov-22 2:37 
AnswerRe: How to put the condition if the array may be empty? Pin
Richard MacCutchan26-Nov-22 3:04
mveRichard MacCutchan26-Nov-22 3:04 
GeneralRe: How to put the condition if the array may be empty? Pin
Cris29M26-Nov-22 3:43
Cris29M26-Nov-22 3:43 
GeneralRe: How to put the condition if the array may be empty? Pin
Richard MacCutchan26-Nov-22 4:41
mveRichard MacCutchan26-Nov-22 4:41 
GeneralRe: How to put the condition if the array may be empty? Pin
Cris29M26-Nov-22 4:53
Cris29M26-Nov-22 4:53 
QuestionAddress Book System Help Pin
Ghost 717-Nov-22 19:19
Ghost 717-Nov-22 19:19 
SuggestionRe: Address Book System Help Pin
Richard MacCutchan17-Nov-22 20:38
mveRichard MacCutchan17-Nov-22 20:38 
AnswerRe: Address Book System Help Pin
CHill6018-Nov-22 0:02
mveCHill6018-Nov-22 0:02 
QuestionTravel Salesman Problem find itinerary with highest visited sites attractiveness score Pin
Faroug Tifratene16-Nov-22 0:36
Faroug Tifratene16-Nov-22 0: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.
QuestionJavaFX ScrollPane scroll child to bottom Pin
MVSoftVM14-Nov-22 6:30
MVSoftVM14-Nov-22 6:30 
AnswerRe: JavaFX ScrollPane scroll child to bottom Pin
englebart19-Nov-22 15:53
professionalenglebart19-Nov-22 15:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.