Map of a warehouse

Imagine a warehouse where a robot is expected to collect items that were
ordered but the environment is cramped so a robot should avoid going
through specific areas to avoid getting damaged. A similar scenario is where a
robot has to pick items in a dangerous environment (such as after a
radioactive spillage), avoiding items of debris. In this assignment you are
expected to program route finding for such a robot. The intention is to pick up
items avoiding going over debris, prioritising distance travelled (due to limited
charge in a battery). An item of debris is also referred to as ‘bump’ because
they are like road speedbumps to a robot.
Given a map of a warehouse with location of items, their value and items of
debris, the idea is to
● go to the nearest location so long as it is possible to avoid going over
debris
● if multiple items are at the same distance, pick the one with the highest
value.
● if navigating to the remaining items requires going over debris then pick
closest item (cannot avoid going over debris).
The above is broadly the strategy you are expected to implement. In principle,
a better strategy would be to explore possible routes in order to find one that
does not require going over debris or even better assign a ‘penalty’ in a form
of travelling distance for going over debris. All of this you will be able to
program in the future. The purpose of this assignment is to test your skill at
implementing simple algorithms and programming in Ruby hence you are only
supposed to implement a simple strategy described above.