************** Input ************** ------------------------------ The input graph is: (31, 0) (48, 0) (37, 8) (43, 9) (30, 13) (38, 20) (42, 19) (50, 25) (39, 30) (41, 30) (36, 40) (46, 40) (47, 75) (40, 50) (49, 55) (34, 60) (33, 70) (44, 65) (0, 5) (10, 4) (17, 40) (5, 50) (12, 60) (60, 1) (65, 14) (69, 55) (74, 43) (78, 2) ------------------------------ ************** Sorted ************** ------------------------------ Sort the graph by x coordinate: (0, 5) (5, 50) (10, 4) (12, 60) (17, 40) (30, 13) (31, 0) (33, 70) (34, 60) (36, 40) (37, 8) (38, 20) (39, 30) (40, 50) (41, 30) (42, 19) (43, 9) (44, 65) (46, 40) (47, 75) (48, 0) (49, 55) (50, 25) (60, 1) (65, 14) (69, 55) (74, 43) (78, 2) ------------------------------ ------------------------------ Sort the graph by y coordinate: (31, 0) (48, 0) (60, 1) (78, 2) (10, 4) (0, 5) (37, 8) (43, 9) (30, 13) (65, 14) (42, 19) (38, 20) (50, 25) (39, 30) (41, 30) (17, 40) (36, 40) (46, 40) (74, 43) (5, 50) (40, 50) (49, 55) (69, 55) (12, 60) (34, 60) (44, 65) (33, 70) (47, 75) ------------------------------ ************** Process ************** ------------------------------ compute: (0, 5) (5, 50) (10, 4) ---------------------- d1.value = 10.05 ---------------------- ------------------------------ compute: (12, 60) (17, 40) (30, 13) (31, 0) ---------------------- d2.value = 13.04 ---------------------- ------combine------------------------------ sorted by y coordinate for those nodes within d of L ------------------------------ (10, 4) (0, 5) (17, 40) (5, 50) (12, 60) ------------------------------ ---------------------- d1.value = 10.05 ---------------------- ------------------------------ compute: (33, 70) (34, 60) (36, 40) ---------------------- d1.value = 10.05 ---------------------- ------------------------------ compute: (37, 8) (38, 20) (39, 30) (40, 50) ---------------------- d2.value = 10.05 ---------------------- ------combine------------------------------ sorted by y coordinate for those nodes within d of L ------------------------------ (37, 8) (38, 20) (39, 30) (36, 40) (40, 50) (34, 60) (33, 70) ------------------------------ ---------------------- d2.value = 10.05 ---------------------- ------combine------------------------------ sorted by y coordinate for those nodes within d of L ------------------------------ (31, 0) (37, 8) (30, 13) (38, 20) (39, 30) (36, 40) (40, 50) (34, 60) (33, 70) ------------------------------ ---------------------- d1.value = 8.60 ---------------------- ------------------------------ compute: (41, 30) (42, 19) (43, 9) ---------------------- d1.value = 10.05 ---------------------- ------------------------------ compute: (44, 65) (46, 40) (47, 75) (48, 0) ---------------------- d2.value = 10.44 ---------------------- ------combine------------------------------ sorted by y coordinate for those nodes within d of L ------------------------------ (48, 0) (43, 9) (42, 19) (41, 30) (46, 40) (44, 65) (47, 75) ------------------------------ ---------------------- d1.value = 10.05 ---------------------- ------------------------------ compute: (49, 55) (50, 25) (60, 1) ---------------------- d1.value = 26.00 ---------------------- ------------------------------ compute: (65, 14) (69, 55) (74, 43) (78, 2) ---------------------- d2.value = 13.00 ---------------------- ------combine------------------------------ sorted by y coordinate for those nodes within d of L ------------------------------ (60, 1) (65, 14) (50, 25) (49, 55) (69, 55) ------------------------------ ---------------------- d2.value = 13.00 ---------------------- ------combine------------------------------ sorted by y coordinate for those nodes within d of L ------------------------------ (48, 0) (43, 9) (42, 19) (50, 25) (41, 30) (46, 40) (49, 55) (44, 65) (47, 75) ------------------------------ ---------------------- d2.value = 10.00 ---------------------- ------combine------------------------------ sorted by y coordinate for those nodes within d of L ------------------------------ (48, 0) (37, 8) (43, 9) (42, 19) (38, 20) (39, 30) (41, 30) (36, 40) (46, 40) (40, 50) (34, 60) (44, 65) (33, 70) (47, 75) ------------------------------ compare pair of nodes: (48, 0) <--13.60--> (37,8) , (48, 0) <--10.30--> (43,9) , (48, 0) <--19.92--> (42,19) , (48, 0) <--22.36--> (38,20) , (48, 0) <--31.32--> (39,30) , (48, 0) <--30.81--> (41,30) , (48, 0) <--41.76--> (36,40) , (48, 0) <--40.05--> (46,40) , (48, 0) <--50.64--> (40,50) , (48, 0) <--61.61--> (34,60) , (48, 0) <--65.12--> (44,65) compare pair of nodes: (37, 8) <--6.08--> (43,9) , (37, 8) <--12.08--> (42,19) , (37, 8) <--12.04--> (38,20) , (37, 8) <--22.09--> (39,30) , (37, 8) <--22.36--> (41,30) , (37, 8) <--32.02--> (36,40) , (37, 8) <--33.24--> (46,40) , (37, 8) <--42.11--> (40,50) , (37, 8) <--52.09--> (34,60) , (37, 8) <--57.43--> (44,65) , (37, 8) <--62.13--> (33,70) compare pair of nodes: (43, 9) <--10.05--> (42,19) , (43, 9) <--12.08--> (38,20) , (43, 9) <--21.38--> (39,30) , (43, 9) <--21.10--> (41,30) , (43, 9) <--31.78--> (36,40) , (43, 9) <--31.14--> (46,40) , (43, 9) <--41.11--> (40,50) , (43, 9) <--51.79--> (34,60) , (43, 9) <--56.01--> (44,65) , (43, 9) <--61.81--> (33,70) , (43, 9) <--66.12--> (47,75) compare pair of nodes: (42, 19) <--4.12--> (38,20) , (42, 19) <--11.40--> (39,30) , (42, 19) <--11.05--> (41,30) , (42, 19) <--21.84--> (36,40) , (42, 19) <--21.38--> (46,40) , (42, 19) <--31.06--> (40,50) , (42, 19) <--41.77--> (34,60) , (42, 19) <--46.04--> (44,65) , (42, 19) <--51.79--> (33,70) , (42, 19) <--56.22--> (47,75) compare pair of nodes: (38, 20) <--10.05--> (39,30) , (38, 20) <--10.44--> (41,30) , (38, 20) <--20.10--> (36,40) , (38, 20) <--21.54--> (46,40) , (38, 20) <--30.07--> (40,50) , (38, 20) <--40.20--> (34,60) , (38, 20) <--45.40--> (44,65) , (38, 20) <--50.25--> (33,70) , (38, 20) <--55.73--> (47,75) compare pair of nodes: (39, 30) <--2.00--> (41,30) , (39, 30) <--10.44--> (36,40) , (39, 30) <--12.21--> (46,40) , (39, 30) <--20.02--> (40,50) , (39, 30) <--30.41--> (34,60) , (39, 30) <--35.36--> (44,65) , (39, 30) <--40.45--> (33,70) , (39, 30) <--45.71--> (47,75) compare pair of nodes: (41, 30) <--11.18--> (36,40) , (41, 30) <--11.18--> (46,40) , (41, 30) <--20.02--> (40,50) , (41, 30) <--30.81--> (34,60) , (41, 30) <--35.13--> (44,65) , (41, 30) <--40.79--> (33,70) , (41, 30) <--45.40--> (47,75) compare pair of nodes: (36, 40) <--10.00--> (46,40) , (36, 40) <--10.77--> (40,50) , (36, 40) <--20.10--> (34,60) , (36, 40) <--26.25--> (44,65) , (36, 40) <--30.15--> (33,70) , (36, 40) <--36.69--> (47,75) compare pair of nodes: (46, 40) <--11.66--> (40,50) , (46, 40) <--23.32--> (34,60) , (46, 40) <--25.08--> (44,65) , (46, 40) <--32.70--> (33,70) , (46, 40) <--35.01--> (47,75) compare pair of nodes: (40, 50) <--11.66--> (34,60) , (40, 50) <--15.52--> (44,65) , (40, 50) <--21.19--> (33,70) , (40, 50) <--25.96--> (47,75) compare pair of nodes: (34, 60) <--11.18--> (44,65) , (34, 60) <--10.05--> (33,70) , (34, 60) <--19.85--> (47,75) compare pair of nodes: (44, 65) <--12.08--> (33,70) , (44, 65) <--10.44--> (47,75) compare pair of nodes: (33, 70) <--14.87--> (47,75) ---------------------- mini.value = 2.00 ---------------------- ************** Result ************** ------------------------------ The Closest Pair of Points is: (39, 30) <--> (41, 30) The distance is: 2.00 ------------------------------ Press any key to continue