Preprint / Version 1

Autonomous Robot Navigation Using a Genetic Algorithm

Implementations in C and Python and Their Relevance to AGVs

##article.authors##

DOI:

https://doi.org/10.31224/8843

Keywords:

automated guided vehicles, genetic algorithm, mobile robot navigation, obstacle avoidance, path planning, AGV

Abstract

A mobile robot must travel from a start cell to a goal cell without touching obstacles, ideally along a short and smooth route.
This paper presents a genetic algorithm (GA) that solves this path-planning problem on grid maps and mazes, implemented twice: in C for square N × N obstacle grids and in Python for rectangular mazes of any size generated with the pyamaze library. A route is encoded as a short chromosome whose genes give the column (or row) the robot occupies in each row (or column), so a route across a 20 × 20 grid needs only 20 numbers. The fitness function multiplies a feasibility factor by normalized length and turn factors, which drives the population first to collision-free routes and then to short, smooth ones; rank selection, block crossover and single-gene mutation breed each new generation. The C program solved the original 8 × 8 map in 4 to 8 generations in all seven runs, a random 20 × 20 map with 21.5% obstacles in 59 to 1,947 generations in all twelve runs, and a 40 × 40 map in the original project. The Python program solved 18 × 18 and 20 × 26 mazes in 252 and 3,953 generations. Unchanged, the C program also routed a vehicle through a warehouse-style layout of racks, pallets and a charger in all three runs. The paper relates these results to automated guided vehicles (AGVs) and autonomous mobile robots, where GAs are studied for route optimization and multi-vehicle planning, sets out the limits of the method against graph-search planners such as A*, and lists concrete improvements to both programs.

Downloads

Download data is not yet available.

Author Biography

Furqan Yousaf, University of Engineering and Technology, Lahore, Pakistan.

2021mc64@student.uet.edu.pk, ORCID https://orcid.org/0009-0005-5151-9085, affiliation Department of Mechatronics and Control Engineering, University of Engineering and Technology, Lahore, Country Pakistan.

Posted

2026-11-20