P
Piotre Ugrumov
I ahve this map of a musem:
7 -- EXIT(8) -- 3
| | |
6 -- 4 -- 2
| | |
5 -- ENTRY(0)--1
The number are the ID of the room. I must implement a method that takes an
ID and calculates the path to the exit.
I have inserted the map of the museum in a database. I have created a table
the fields of this table are: ID, RoomName, RoomOnLetf, RoomOnRight, RoomUp,
RoomDown.
For example the room 2:
ID RoomName RoomOnLeft RoomOnRight RoomUP RoomDown
2 Room2 4 --
3 1
This method must consult this table and must determinate the path to the
EXIT, this path must be inserted in a string.
What algorithm can I use to do this thing?
Where can I find it?
Thanks.
7 -- EXIT(8) -- 3
| | |
6 -- 4 -- 2
| | |
5 -- ENTRY(0)--1
The number are the ID of the room. I must implement a method that takes an
ID and calculates the path to the exit.
I have inserted the map of the museum in a database. I have created a table
the fields of this table are: ID, RoomName, RoomOnLetf, RoomOnRight, RoomUp,
RoomDown.
For example the room 2:
ID RoomName RoomOnLeft RoomOnRight RoomUP RoomDown
2 Room2 4 --
3 1
This method must consult this table and must determinate the path to the
EXIT, this path must be inserted in a string.
What algorithm can I use to do this thing?
Where can I find it?
Thanks.