Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Kinda the same thing in the Wolfram Language:

    With[{
    	geopositions = ParallelMap[
    		First[
    			StringCases[
    				URLFetch["http://www.teslamotors.com" <> #],
    				("https://maps.google.com/maps?daddr=" ~~ a: Except["\""]..) :> Interpreter["StructuredGeoCoordinates"][a]
    			]
    		]&,
    		StringCases[
    			URLFetch["http://www.teslamotors.com/findus/list/superchargers/United+States"],
    			"/findus/location/supercharger/" ~~ WordCharacter..
    		]
    	]},
    	GeoGraphics[GeoPath[geopositions[[Last[FindShortestTour[geopositions]]]]]]
    ]
and the result

http://imgur.com/THIwnIY



I believe they also use Concorde behind the scenes to actually solve the TSP instance.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: