code for coverage path planning for cleaning robot

i need code and complete info regarding the implementation of coverage path planning(zigzag) for my cleaning robot to clean up any entire space.

(deleted)

help me with it

Do you need help with existing code? Or are you looking to hire someone to write the code for you?

In any case, you must provide lots more information on what you want to get done exactly.

to clean up any entire space.

How is the Arduino supposed to know what the space looks like? If you hard-code data about the space (length and width, if it's rectangular, for instance) AND the robot is started at some known location in the space AND the robot knows how wide an area it can clean on a given path AND the robot can turn very precise amounts on any surface (or on the range of surfaces it is supposed to clean), AND the robot knows how long it takes to traverse a given distance, then calculating a path to cover an entire space is non-trivial but not that hard. Converting the path to start, stop, turn instructions is relatively straight-forward. Implementing the start, stop, and turn instructions is straight-forward.

If the robot is supposed to determine the space to be cleaned, then it must have appropriate sensors.

If the robot can't turn very precise amounts without feedback (and it is highly unlikely that it can), then it needs sensors to provide that feedback.

If the robot can traverse very precise distances in known amounts of time, without feedback (and it is highly unlikely that it can), then it needs sensors to provide that feedback.

If you can't modify the space to provide the sensors with something to measure, then your task is nearly impossible, and you'll have to do what roombas and pool cleaners do. Google drunkards path. Random turns at random times or when the device can't continue in the current direction (who put that f**king chair leg there?), and hope that, sooner or later, you've covered every square inch of the space.