In this paper, we present a new approach to the temporal order restoration of the off-line handwriting. After the preprocessing steps of the word image, a suitable algorithm makes it possible to segment its skeleton in three types of strokes. After that, we developed a genetic algorithm GA in order to optimize the best trajectory of these segments. The repetition of a segment will be studied in a secondary algorithm so that we do not disturb the GA operations. The techniques used in GA are the selection, crossover and the mutation. The fitness function value depends on right-left direction (direction of the Arab writing), the segments repetition and angular deviation on the crossing of the occlusion stroke. To validate our approach, we tested it on the On/Off LMCA dual Arabic handwriting, the Latin IRONOFF and the off-line IFN/ENIT datasets.