Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started