0

Problem Statement: A Research team wants to establish a research center in a region where they found some rare-elements.They want to make it closest to all the rare-elements as close as possible so that they can reduce overall cost of research over there.It is given that all the rare-element’s location is connected by roads.It is also given that Research Center can only be build on road.Team decided to assign this task to a coder.If you feel you have that much potential. Here is the Task :- Find the shortest of the longest distance of research center from given locations of rare-elements. Locations are given in the matrix cell form where 1 represents roads and 0 no road.. number of rare-element and their location was also given(number<=5) and order of square matrix was less than equal to 20

My approach to solve the problem is to start BFS(Breadth First Search) from one of the rare-element location(say X) and replace the value of the road(marked as 1) by the shortest value to reach the cell from that location X. Similarly, start BFS from all the other locations and add the shortest value to the existing cell value. Once BFS is complete for all the locations, scan the matrix for the minimum value.

Will the above approach work? Is there an algorithm specifically meant for such problems?

argcv
  • 39
  • 6
  • Welcome to StackOverflow. Please follow the posting guidelines in the help documentation, as suggested when you created this account. [On topic](https://stackoverflow.com/help/on-topic), [how to ask](https://stackoverflow.com/help/how-to-ask), and ... [the perfect question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/) apply here. – Prune Oct 03 '19 at 21:26
  • We need the problem description to be translated into clear English; the sentence fragments and unresolved anaphors make this too difficult to parse. We also need a clear goal for a problem: the bikes problem and the research center placement are not equivalent. Finally, we expect you to research the topic before posting here; both of these problems are documented quite well on line. – Prune Oct 03 '19 at 21:28
  • Thanks for the clarification. I've removed the bike problem. Didn't find any clear explanation of the problem online, hence posted – argcv Oct 04 '19 at 17:08

0 Answers0