Answered step by step
Verified Expert Solution
Link Copied!

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

Task1: Nearest Neibhour search using python in big data
There is a datasets called restuarents the data set is consisted of 2D data points stored in a text file in following format:
id_1 x1 y1
id_2 x2 y2
.
.
.
id_n 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 200 users interested in finding the nearest shop. Their locations are provided in a text file formatted identical to the datasets.
id_1 x_1 y_1
id_2 x_2 y_2
.
.
.
id_200 x_200 y_200
for example id_1=1, x_1=31.45, y_1=150.44 indicate's a user's location.
find the nearest restaurent for each query using the following algorithm:
1. 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=56, x=34.15, y=149.21, for query 1"
the total running time for processing all 200 queries and the average time per query (divide the total running time by 200)
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions