Skip to content

About

The following text presents a synopsis of the NetworkX algorithms, which have been compiled for the purpose of testing.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Repository files navigation

Path Planning Algorithms using NetworkX

Overview

NetworkX is a free Python library for graphs and networks and is used in many applications and projects in order to find the shortest path in path planning scenarios. For dense graphs, the library provides the Floyd-Warshall algorithm and the A* ("A-Star") algorithm for shortest paths and path lengths.

However, several extensions have been proposed to improve the A* algorithm that are not provided by the library. In this context, this project presents a set of implementations improving the A* algorithm using the NetworkX library, including: IDA*, D* Lite, SMA*, Bidirectional A* and RTA*.

We first review the literature of the usage and general application of NetworkX in different domains of applicability, and then its usage and exploration in shortest path contexts. By reviewing and validating the usage of these extended A* algorithms implemented in Python using NetworkX, the implementations have been tested and validated in a network environment.

We conducted benchmarking of the standard algorithms versus the extended ones, and concluded that A* extensions provide better efficiency in a tri-objective scenario involving path length, cost, and toll.

To foster further research in this specific field of shortest path problems, the source code of all algorithms is available in this open-source GitHub repository.


Directory Structure

.
├── Algorithms              
│   ├── bi_astar.py
│   ├── d_star_lite.py
│   ├── ida_star.py
│   ├── rtaa_star.py
│   └── sma_star.py
│
├── Testers                 
│   ├── bi_astar.py
│   ├── d_star_lite.py
│   ├── ida_star.py
│   ├── rtaa_star.py
│   └── sma_star.py
│
├── Graphs/Plots            
│   └── graphs.py
│
├── Csv                     
│   ├── cities_nodes_special.csv
│   └── cities_nodes_special_original.csv
│
├── main.py                 
└── metrics.xlsx            

Path Planning - Advanced A* Algorithms

Bidirectional A* Algorithm

Bidirectional A*

RTA* Algorithm

RTA*

SMA* Algorithm

SMA*

IDA* Algorithm

IDA*

D* Lite Algorithm

D* Lite


Installation

1. Clone the repository

git clone https://github.com/migcruzz/Testing_NetworkX_Algorithms.git

2. Create and activate a virtual environment (optional but recommended)

python -m venv venv
source venv/bin/activate  

3. Install the dependencies

pip install -r requirements.txt

Running the Project

Make sure the configuration in config.py is properly set (e.g., source and target nodes, memory limits, etc.), and then run:

python main.py

This will:

  • Run all algorithm comparisons in parallel
  • Generate graph images showing paths found by each algorithm
  • Write performance metrics to an Excel file (metrics.xlsx)

About

The following text presents a synopsis of the NetworkX algorithms, which have been compiled for the purpose of testing.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages