/DFS-Searching-Algorithm

This Python code employs the Depth-First Search (DFS) algorithm to find a path from "Arad" to "Bucharest" in the Romania map. It uses a priority queue, backtracking, and a graph representation. The DFS path is printed at the end. Skills demonstrated include graph traversal, priority queue usage, and DFS algorithm implementation.

Primary LanguagePython

DFS Searching Algorithm

Table of Contents

Project Overview

The Python code implements a depth-first search (DFS) algorithm to find a path from the city of Arad to Bucharest in Romania. The DFS algorithm is implemented using a priority queue and a dictionary to keep track of nodes and their respective costs. The code begins by initializing a global variable global_node_id to keep track of node IDs. The function get_next_node_id() increments this global variable whenever a new node is encountered.

Installation

This project requires Python 3.12.1 or later. To set up the project:

  1. Ensure Python 3.12.1 or a later version is installed on your system. You can download Python from python.org.

  2. Clone or download the repository to your local machine.

         git clone https://github.com/jaiswalchitransh/DFS-Searching-Algorithm.git
    
  3. Open the project in your preferred Python environment (e.g., IDE or terminal).

  4. Run the script (dfs_searching_algo.py) and observe the output.

Usage

Run the script:

        python dfs_searching_algo.py

This executes the DFS algorithm to find a path from Arad to Bucharest in the Romania map graph.

Features

  • Implementation: Implements DFS using a priority queue for efficient pathfinding.
  • Output: Outputs the path from Arad to Bucharest.
  • Demonstration: Demonstrates dictionary usage for node management and cost calculation.

Contribution

I, Chitransh Jaiswal developed this Project Individually. I was responsible for all aspects of the project, including design, development, testing, and documentation. Contributions to improve the efficiency, readability, or functionality of the code are welcome. To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add some feature').
  5. Push to the branch (git push origin feature/your-feature).
  6. Create a new Pull Request.

Please ensure your contributions adhere to the coding standards and follow the existing style and structure.


Thank you for your interest in the DFS Searching Algorithm!