Need to evaluate software for ADA paratransit? Read our expert guide.

Via Riddle

A 5-passenger van has a list of requested pickup-dropoff sets in Manhattan (grid). Implement the fastest program possible that finds the route that minimizes the following:

α × V + β × ΣD

V : Entire van route    ΣD : Accumulative ride detour over all rides [(actual ride distance) minus (minimal ride distance possible)]     α and β : Constants

Additional input: van vertex (x,y); list of non-connected edges.

bullet blue Pickup     bullet orange Dropoff
Map

Please send solution (preferably Python) or thoughts to jobs.il@ridewithvia.com

Apply Python Solution

Program CLI should accept a json file as its only parameter, structured as illustrated below.

Actual testing input will be much larger.

{ "gridSizeX": 40, "gridSizeY": 50, "a": 0.7, "b": 0.3, "vanVertex": { "x": 23, "y": 16 }, "rides": [{ "pickup": { "x": 23, "y": 15 }, "dropoff": { "x": 33, "y": 17 } }, { "pickup": { "x": 39, "y": 9 }, "dropoff": { "x": 21, "y": 18 } }], "nonConnectedEdges": [{ "startVertex": { "x": 19, "y": 27 }, "endVertex": { "x": 19, "y": 28 } }, { "startVertex": { "x": 12, "y": 10 }, "endVertex": { "x": 13, "y": 10 } }] }

Program should print van route steps (each and every node) json to the output stream, structured as illustrated below:

{ "vanRoute": [{ "x": 12, "y": 14 }, { "x": 12, "y": 15 }, { "x": 13, "y": 15 }, { "x": 13, "y": 16 }, { "x": 13, "y": 17 }] }

World-changing ideas. Right in your inbox.

Be the first to know about the latest transportation news and innovations.

Mailbox illustration.

Congrats — you're in!

Please fill out the following details:

Interested in learning more about our unique services? Sign up!

Thank you!

We're grateful to have you in our community.

Thumbs up illustration