I downloaded a map of a city, where crossroads are nodes(I even have the exact coordinates of the nodes) and I have the paths between nodes with the length as a whole number. I need to find the longest path, that can be found through an algorithm, in this graph, I can start and end where ever i want, but I have two conditions. I can visit a node only once and I cant see any other street twice (that is, if you take any two vertices of the road that do not follow each other closely, then there will be no edge between them in the graph)
I´ve tried to divide the map into multiple trees, where it is possible to find the longest path, then I connected these trees and calculated the length, but it isn´t enough.
Do you have any ideas on how to solve this problem?
Input may look like this: 3(number of nodes) 3(number of roads) 1(node) 49.485993 16.5789384 (coordinates) 2 49.485994 16.5789345 3 49.485990 16.5789368 1(node) 3(node) 50(lenght in meters) 1 2 90 2 3 110
Here I tried to draw the second condition
