Question: Best First ( BF ) Algorithm Pseudocode of BF algorithm B F ( q ) / * in the following H is a sorted list
Best First BF Algorithm
Pseudocode of BF
algorithm
in the following is a sorted list where each entry is an MBR
whose sorting key in is its mindist to ;
is a global variable that keeps the NN found so far.
insert the MBR of the root in
while is greater than the smallest mindist in
if
remove from the MBR with the smallest mindist
access the child node of
if is an intermediate node then
insert all the MBRs in into
else
if the NN of in is closer to than then
the NN of in
UsiTng BF algorithm, solve the following task:
There is restaurant dataset which consist of D data points. stored in text file with folllowing data format:
id x y
id x y
id n xn yn
each line includes unique id for a data point, and its geographical coordinates longitude and latitude. FOr an example an entry in the restaurant dataset id x y precisely indicates the location of a shop, with x longitutde and y latitude.
we have users are interested in finding nearest restaurant. Their locations are provided in a text file formatted identically to datasets:
id x y
id x y
id x y
use BF algorithm to construct a R Tree for the selected dataset then apply the BF algorithm using the R tree to find the nearest neighbor for each query point.
output shuould display following information in different single text output file:
The id x and y coordinates of the nearest restaurant
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
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
