There are maze running robot mice, which go down every alley and avenue, then calculate the correct path flawlessly. It may be possible to program your robot to keep track of every maneuver it makes. It's a very tall order, however.
To use light, you'll need to shine a beam in all directions, so your robot can see it from all directions. You can spin the robot to search for the beacon, or, install more than one photosensor.