https://github.com/nelsonbn/algorithms-data-structures-graph-traversal
Algorithms and Data Structures - Graphs Traversal
https://github.com/nelsonbn/algorithms-data-structures-graph-traversal
algorithms algorithms-and-data-structures data-structures graphs
Last synced: 8 months ago
JSON representation
Algorithms and Data Structures - Graphs Traversal
- Host: GitHub
- URL: https://github.com/nelsonbn/algorithms-data-structures-graph-traversal
- Owner: NelsonBN
- License: mit
- Created: 2025-03-03T03:33:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-03T03:46:40.000Z (about 1 year ago)
- Last Synced: 2025-03-03T04:27:47.504Z (about 1 year ago)
- Topics: algorithms, algorithms-and-data-structures, data-structures, graphs
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Algorithms and Data Structures - Graphs Traversal
## Demos
### From Matrix to Graph
**Problem**
Given a matrix, we will traverse it with graph traversal techniques to find the target element.

**Movements Graph**
```mermaid
graph LR
A((0,0))
B((0,1))
C((0,2))
D((0,3))
E((1,1))
F((1,3))
G((2,0))
H((2,1))
I((2,2))
J((2,3))
K((3,0))
L((3,3))
M((4,1))
N((4,2))
O((4,3))
style B stroke:#0AF,stroke-width:2px;
style M stroke:#FA0,stroke-width:2px;
B <--> A
B <--> E
B <--> C
C <--> D
D <--> F
E <--> H
F <--> J
H <--> G
H <--> I
I <--> J
J <--> L
G <--> K
L <--> O
O <--> N
M <--> N
```
**Notes**
- The position start is at (0,1) where the cell has the value 'S'
- The target position is at (4,1) where the cell has the value 'E'
- The cells with the value 'X' are blocked cells
**Traversal**
- [Matrix - DFS (Depth-First Search) Traversal](./src/matrix_dfs.py)
- [Matrix - BFS (Breadth-First Search) Traversal](./src/matrix_bfs.py)
## References
- [Other Algorithms & Data Structures](https://github.com/NelsonBN/algorithms-data-structures)