Skip to content

Latest commit

 

History

History
75 lines (66 loc) · 3.4 KB

README.md

File metadata and controls

75 lines (66 loc) · 3.4 KB

Route Optimizer

This repository contains code for a Route Optimizer that implements Dijkstra's algorithm to find the shortest path between nodes in a graph and generates visualizations of the graph.

Introduction

The Route Optimizer project aims to optimize routes and find the shortest path between nodes in a graph. It provides functionality to load input data, generate graphs, calculate weights, and visualize the resulting graph.

Installation

To use the Route Optimizer, follow these steps:

  1. Install the gnuplot based on your operation system here: http://www.gnuplot.info/download.html and follow the instruction
  2. Clone the repository:
  3.     $ git clone <repository_url>
        $ cd <repository_directory> // look for where main.exe file located to 
  4. Build the project (if required) using your preferred build system.
  5. Run the program:
  6.     $ ./main.exe

Note: if you can't run the program. Remember to check the directory path for the files.

Features

  • Shortest Path Calculation: The algorithm.cpp file contains an implementation of Dijkstra's algorithm, which can find the shortest path between nodes in a graph.
  • Graph Generation: The graph.cpp file provides functionality to generate a graph based on input data and save it as an image file.

Usage

To find the shortest path between nodes:

  1. Modify the input data in the appropriate files (pnts.txt and edges.txt) to represent your graph.
  2. Compile and run the program.
  3. The program will calculate and display the shortest path between nodes using Dijkstra's algorithm.

To generate a graph:

  1. Modify the input data in the appropriate files (pnts.txt and edges.txt) to represent your graph.
  2. Compile and run the program.
  3. The program will generate a visualization of the graph and save it as an image file (graph.png).

File Structure

  • algorithm.cpp: Contains the implementation of Dijkstra's algorithm to find the shortest path.
  • graph.cpp: Provides functionality to generate a graph and visualize it.
  • pnts.txt: Input file containing the coordinates and labels of the graph's nodes.
  • edges.txt: Input file containing the edges of the graph.

Contributing

Contributions to this project are welcome! If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and test them thoroughly.
  4. Commit your changes and push them to your forked repository.
  5. Submit a pull request, describing the changes you've made.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Contact

If you have any questions or suggestions regarding this project, feel free to contact me: