The wavefront algorithm, if it is what I think it is, requires a map to already exist.
Maps can be built by hand, or they can be constructed on-the-fly by a sufficiently advanced robot using a technique called SLAM (simultaneous locating and mapping.)
To understand how this works, you need to understand some amount of physics and mechanics, and a pretty large amount of computer science and math. If you do not have that knowledge already, then the fastest way to understand it is probably to study up on those areas first.