Integrated Path Planning and Facility Location Optimization for UAV-UGV Networks
This repository implements a novel Facility Location and Path Optimization (FLPO) algorithm using deterministic annealing and free energy minimization to solve the integrated path planning and facility location problem for UAV-UGV (Unmanned Aerial Vehicle - Unmanned Ground Vehicle) networks.
The FLPO algorithm addresses the complex challenge of simultaneously optimizing:
- UAV route planning through charging stations to destinations
- UGV charging station placement in the operational environment
- Obstacle avoidance using geometric path planning
- Charge constraints based on UAV battery levels and full charge range (FCR)
- β Probabilistic routing using temperature-controlled associations
- β Obstacle avoidance via Dijkstra's algorithm on polygon vertices
- β Deterministic annealing optimization with deterministic convergence
- β Multiple algorithm benchmarking (GA, SA, CEM, PSO, Gurobi)
- β Interactive visualization with static plots and animated routes
- β Normalized coordinate system for numerical stability
- Installation
- Quick Start
- Usage
- Algorithm Details
- Benchmarking
- Visualization
- Project Structure
- Contributing
- License
- Python 3.8 or higher
- pip package manager
# Clone the repository
git clone https://github.com/salar96/UAV-UGV-Optimization.git
cd UAV-UGV-Optimization
# Install dependencies
pip install -r requirements.txt
# Optional: Install Gurobi for commercial optimization comparison
# pip install gurobipyCore dependencies are automatically installed via requirements.txt:
numpy- Numerical computationsscipy- Optimization algorithmsmatplotlib- Visualization and animationshapely- Geometric operations for obstaclespyomo- Mathematical optimization modeling (for Gurobi benchmarks)
from UAV_Net import UAV_Net
from annealing import anneal
from viz import plot_drone_routes
import numpy as np
# Define drone missions: ((start_x, start_y), (dest_x, dest_y), charge_level)
drones = [
((10.0, 5.0), (45.0, 50.0), 0.7), # High charge, long distance
((20.0, 15.0), (35.0, 35.0), 0.6), # Medium charge, moderate distance
((5.0, 30.0), (25.0, 5.0), 0.4), # Low charge, short distance
]
# Initialize charging station positions
N_stations = 3
init_ugv = np.array([[0.3, 0.7], [0.6, 0.4], [0.8, 0.8]])
# Set optimization parameters
fcr = 25.0 # Full Charge Range
ugv_factor = 0.0 # UGV movement cost factor
# Create optimization network
uav_net = UAV_Net(drones, N_stations, init_ugv, blocks=None,
ugv_factor=ugv_factor, fcr=fcr, distance="euclidean")
# Run deterministic annealing optimization
Y_s, Betas = anneal(
obj=uav_net.objective,
init_stations=uav_net.stations,
bounds=uav_net.bounds,
beta_init=1e-4,
beta_f=1e4,
alpha=2.0,
purturb=1e-6,
method='powell',
verbos=True
)
# Get optimized routes
from FLPO import calc_associations, calc_routs
P_ss = calc_associations(uav_net.D_ss, Betas[-1])
routes = calc_routs(P_ss)
# Visualize results
plot_drone_routes(drones, Y_s[-1], blocks=None, routes=routes,
fcr=fcr, ugv_factor=ugv_factor)The FLPO algorithm combines:
- Free Energy Minimization: Uses probabilistic associations between drones and charging stations
- Deterministic Annealing: Temperature-controlled optimization from Ξ²_init=1e-4 to Ξ²_f=1e4
- Smooth Penalty Functions: Handles charge constraints without hard boundaries
- Coordinate Normalization: Maps all coordinates to [0,1] for numerical stability
| Parameter | Default | Description |
|---|---|---|
beta_init |
1e-4 | Initial temperature parameter |
beta_f |
1e4 | Final temperature parameter |
alpha |
2.0 | Temperature growth rate |
fcr |
25.0 | Full Charge Range for UAVs |
purturb |
1e-6 | Random perturbation in optimization |
- Relative cost change < 1e-4
- Maximum iterations reached
- Temperature ceiling achieved
Compare FLPO against state-of-the-art optimization algorithms:
# Run benchmark comparison (see benchmark.ipynb)
algorithms = ['FLPO', 'GA', 'SA', 'CEM', 'PSO', 'Gurobi']
# Results automatically saved to Benchmark/ directory- Genetic Algorithm (GA) -
Benchmark/GA.py - Simulated Annealing (SA) -
Benchmark/SA.py - Cross-Entropy Method (CEM) -
Benchmark/CEM.py - Particle Swarm Optimization (PSO) -
Benchmark/PSO.py - Gurobi MIP Solver -
Benchmark/GurobiSolver.py(requires license)
from viz import plot_drone_routes
plot_drone_routes(drones, stations, blocks, routes, fcr, ugv_factor, save_=True)from animator import animate_drone_routes
animate_drone_routes(drones, stations, blocks, routes, fcr, ugv_factor,
animation_speed=2.0, fps=30, save_path="animation.gif")from utils import create_block
# Create various obstacle shapes
hexagon = create_block("hexagon", center=(30.0, 30.0), length=3.0)
square = create_block("square", center=(15.0, 25.0), length=3.5, distortion="rotated")
triangle = create_block("triangle", center=(30.0, 10.0), length=2.0, distortion="skewed")UAV-UGV-Optimization/
βββ π main.ipynb # Primary research notebook
βββ π benchmark.ipynb # Algorithm comparison experiments
βββ π UAV_Net.py # Core optimization network class
βββ π FLPO.py # Free energy and association functions
βββ π annealing.py # Deterministic annealing implementation
βββ π viz.py # Static visualization functions
βββ π animator.py # Animation visualization
βββ π ObstacleAvoidance.py # Geometric path planning
βββ π normalizers.py # Coordinate normalization utilities
βββ π utils.py # General utility functions
βββ π Benchmark/ # Comparison algorithms
β βββ GA.py, SA.py, CEM.py, PSO.py, GurobiSolver.py
β βββ N{drones}_M{stations}_seed{seed} # Results cache
βββ π requirements.txt # Dependencies
βββ π .github/copilot-instructions.md # AI agent guidelines
βββ π README.md # This file
main.ipynb- Complete optimization workflow with visualizationbenchmark.ipynb- Algorithm performance comparison with statistical analysis
- Multi-drone missions with varying charge levels
- Complex obstacle environments with geometric shapes
- Large-scale networks with 10+ drones and 5+ stations
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 style conventions
- Add docstrings to all functions
- Include unit tests for new features
- Update documentation for API changes
This project is licensed under the MIT License - see the LICENSE file for details.
If you use this code in your research, please cite:
@misc{uav-ugv-optimization,
title={Our paper},
author={},
year={2025},
url={https://github.com/salar96/UAV-UGV-Optimization}
}For questions, issues, or feature requests:
- π§ Create an Issue
- π¬ Start a Discussion
- π Check the Wiki