Hi,
I have tried to create a system to determine the Hamilton cycles in a graph, Paste 371394. Unfortunately, when I set the starting point to "Berlin" I the proper route that visits all cities, but it is not returned as a list of lists (containing the cities), but rather as a list of lists of lists of list... you get the idea. I'm using PLT and tried to find my error via the debugger but so far, I have failed to find my problem.
Thanks in advance!
Problems with list of list of list of list...
Re: Problems with list of list of list of list...
You're actually quite close, except in this step near line 72
Bear with me: A route is a list of strings. found-routes is a list of routes.. call this type (list route). the lambda will be invoked with r of type 'route', and find-routes returns a (list route), so this lambda is of type "route -> (list route)", making the map return a (list (list route)), when you want a (list route) that is the concatenated list of all the find-route results.
Code: Select all
(map
(lambda (r) (find-routes r flight-plan))
found-routes)