Question: Task 1 : Nearest Neibhour search using python in big data There is a datasets called restuarents the data set is consisted of 2 D
Task: Nearest Neibhour search using python in big data
There is a datasets called restuarents the data set is consisted of D data points stored in a text file in following format:
id x y
id x y
idn xn yn
each line includes a unique id for a point and its geographical coordinates, longititude and latitud. for example the entry in the dataset, precisely indicates the location of the restaurent. with x representing ongitude and y representing latitude.
Queries: we have users interested in finding the nearest shop. Their locations are provided in a text file formatted identical to the datasets.
id x y
id x y
id x y
for example id x y indicate's a user's location.
find the nearest restaurent for each query using the following algorithm:
sequential scan based method: calculate the distance between a query point to every point in the selected dataset to find the nearest neibhor.
The output should display in the following format:
The ID x and y coordinates of the nearest neibhor identified for each query point
id x y for query
the total running time for processing all queries and the average time per query divide the total running time by
i want python code for the above requirements, assume that you have two data text files which is in the above format.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
