Link to home
Start Free TrialLog in
Avatar of John Doe
John Doe

asked on

Rank the list of search results

A traveller searches for trips from Bern to Berlin on Dec 25, 2013, from 8am (one-way).
A list of the 20 first results returned by a tool is given in the attached ex3-data.json file.

Tips: most fields are self-explanatory, while some may need explanation:
1. boo_return is true for a return trip, false otherwise
2. workTime_sec is the duration that the traveler can work during that part of the trip in seconds.
3. duration_out_sec is the duration of the corresponding outbound part of the trip, in seconds. For return trip, if applicable, there will be a similar field duration_in_sec for the duration of the inbound trip part.

Goals
1. Propose a solution to rank the list of results provided in the attached file.
2. Output the list of ranked results to a file named ex3-output.json.
   Each result must have two additional properties “rank” and “score”, respectively storing the final rank and the score of the trip (If applicable).

========================================
ex3-data.txt
Avatar of arnold
arnold
Flag of United States of America image

Do you have a starting point to what considerations you are looking at?

Which items from the results are important, duration of trip, or ability to perform tasks during the trip?
Avatar of John Doe
John Doe

ASKER

No starting points, just provide your search logic, or explain please your thinking / rationale of your ranking function.
I think duration of the trip is more important.

or you can play here https://www.routerank.com
The tips is the reason for the consideration

lets set a scenario person A travels from Point A to point B.
wihle the shorter trip is 45 minutes, but work can not be performed.... and potentially other costs are involved.
the other option is 60 minutes that person A can use to perform work.

while the longer duration takes 15 extra minutes, Person A during the 60 minutes can accomplish things that could not be completed in the 15 minutes save from the duration of the transport. or potentially the 15 minutes are wasted looking for where to park the car.

I'd help you analyze and evaluate the possible answers, but you need to add your thoughts to the exchange.
Looks good... could you please convert it into code ?
not fully familiar with the code you need.
someone can help with the code ?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.