It looked like the relevant information was edited into the question, so I removed comments on the question prior to migration.
The relevant responses are below.
This makes no sense. If you know the room ID and the numbers on the doors you have all the information you need in order to backtrack. Thus how can you say no backtracking unless the robot has no memory--but in that case you can't apply any intelligence to it anyway--simply choose a random door. --Loren Pechtel
@Loren, initially robot doesn't know where is he. Only ID of current room and IDs of doors from it. While it moves from room to room he of course can store to memory visited rooms. The only problem is that he doesn't know where he came from (what door ID of new room leads back to previous room) when enter new room. --archer
@Loren The door IDs are not the same as the room IDs, right archer? --Byte56
Yes. For example, we have rooms 1, 2, 3. Inside room 1 we have doors A, B. Inside room 2: A, B, C... etc. --archer