Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nurullah-arican/pcbwiringpathfinder
Finds the shortest path for a wire in a 14x14 PCB grid using BFS.
https://github.com/nurullah-arican/pcbwiringpathfinder
bfs pcb
Last synced: 26 days ago
JSON representation
Finds the shortest path for a wire in a 14x14 PCB grid using BFS.
- Host: GitHub
- URL: https://github.com/nurullah-arican/pcbwiringpathfinder
- Owner: nurullah-arican
- Created: 2024-11-04T19:38:19.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-04T19:44:35.000Z (3 months ago)
- Last Synced: 2024-11-17T08:49:55.989Z (3 months ago)
- Topics: bfs, pcb
- Language: C++
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shortest Path in PCB Grid
This project finds the shortest route for a wire in a 14x14 PCB grid using a Breadth-First Search (BFS) algorithm. The grid contains unreachable tiles, a starting tile, and a target tile. The program uses a queue data structure to traverse the grid and determine the shortest path from the start to the target.
## Project Overview
- **Grid Size:** 14x14
- **Tiles:**
- `S` - Start Tile
- `T` - Target Tile
- `U` - Unreachable Tile
- `e` - Empty Tile
- `W` - Wire (path from Start to Target)The program places the `START` and `TARGET` tiles randomly within the grid and fills 20 tiles as unreachable. It then performs a BFS algorithm to find the shortest path between the start and target tiles, marking the path with `W` if it exists.
## Features
- **Random Grid Generation:** The grid is initialized with random placement of unreachable tiles, start, and target tiles.
- **Breadth-First Search (BFS):** The algorithm uses BFS to ensure that the shortest path is found.
- **Path Marking:** If a path is found, it is marked on the grid with `W` to visualize the route.## Usage
### Requirements
- **C++ Compiler:** The code requires a C++ compiler that supports C++11 or higher.
### Compilation and Execution
1. Compile the code with a C++ compiler:
```bash
g++ -o PCBShortestPath PCBShortestPath.cpp
2. Run the program:
./PCBShortestPath## Output
The program will print the grid after attempting to find the shortest path from the start to the target tile. If a path is found, it will be marked with W; otherwise, a message will indicate that no path was found.