PSO-AI-Optimization is an experimental research project that applies Particle Swarm Optimization (PSO)—a bio-inspired metaheuristic algorithm—to the complex problem of autonomous robot path planning. Instead of relying on traditional algorithms like A* or Dijkstra, this project utilizes swarm intelligence to discover near-optimal, collision-free routes across diverse, structured grid environments (like warehouses and mazes). The goal is to dynamically find the shortest, safest, and most energy-efficient paths using collective swarm behavior.
A from-scratch implementation of Particle Swarm Optimization featuring configurable swarm sizes, iteration counts, and customizable weights.
Calculates composite scores for paths based on distance, travel time, energy expenditure, and collision penalties.
Pre-configured to test the algorithm across 4 distinct layouts: Original, Maze, Corridor, and Warehouse.
Employs a path mutation operator that dynamically perturbs waypoints to ensure diversified exploration of the solution space.
Features fitness convergence tracking to analyze algorithm behavior over time, paired with clear, color-coded Matplotlib grid visualizations.
Generates a swarm of N particles, where each particle holds a randomly generated path through the grid.
Every path is scored using a configurable fitness formula combining weighted distance, time, energy, and collision penalties.
Each particle remembers its personal best path, while the system tracks the swarm's overall global best.
To explore new routes, the algorithm randomly mutates (perturbs) waypoints in the personal best paths rather than using standard velocity vectors.
This loop repeats for a set number of iterations, continuously refining the routes until the global best path is finalized and returned.
Upgrade the path mutation operator to utilize proper continuous or discrete PSO velocity vectors for mathematically strict swarm movement.
Implement real-time moving obstacles during the optimization phase to simulate unpredictable agents (like moving forklifts or human workers) on a warehouse floor.
Combine the PSO algorithm with an A* algorithm for better initial population seeding, and build a benchmarking suite to directly compare performance against Genetic Algorithms and Ant Colony Optimization (ACO).
Expand the mathematical model to solve multi-agent path planning, ensuring collision avoidance not just with walls, but between multiple robots operating simultaneously.
Interested in this project?