MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / trip

Method trip

src/nodejs/node_osrm.cpp:591–598  ·  view source on GitHub ↗

clang-format off * The trip plugin solves the Traveling Salesman Problem using a greedy heuristic * (farthest-insertion algorithm) for 10 or * more waypoints and uses brute force for less than 10 * waypoints. The returned path does not have to be the shortest path, * as TSP is NP-hard it is * only an approximation. * * Note that all input coordinates have to be connected for the trip service

Source from the content-addressed store, hash-verified

589 */
590// clang-format on
591Napi::Value Engine::trip(const Napi::CallbackInfo &info)
592{
593 osrm::Status (osrm::OSRM::*trip_fn)(const osrm::TripParameters &params,
594 osrm::engine::api::ResultT &result) const =
595 &osrm::OSRM::Trip;
596 async(info, &argumentsToTripParameter, trip_fn, true);
597 return info.Env().Undefined();
598}
599
600/**
601 * All plugins support a second additional object that is available to configure some NodeJS

Callers 3

trip.jsFile · 0.80
nonRoundtripChecksFunction · 0.80
roundtripChecksFunction · 0.80

Calls 1

asyncFunction · 0.85

Tested by

no test coverage detected