Closed yashksaini-coder closed 1 week ago
๐ Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!
Feel free to join our community on Discord to discuss more!
โ Closes: #249
This pull request introduces a comprehensive update to the
pysnippets
library, focusing on enhancing the graph traversal algorithms and improving the overall structure and documentation. The most important changes include the addition of a detailed documentation file, implementation of BFS and DFS algorithms, introduction of data classes for graph structures, and setting up a logging configuration.Documentation and Structure:
pysnippets/Traversal/Traversal.md
: Added a detailed documentation file covering the overview, data structures, traversal algorithms, usage, logging, testing, examples, contributing guidelines, and license information.Algorithms Implementation:
pysnippets/Traversal/bfs.py
: Implemented thebreadth_first_search
,bfs_level_order
, andfind_shortest_path
functions with enhanced features such as optional target node, maximum depth limit, and logging.pysnippets/Traversal/dfs.py
: Implemented thedepth_first_search
function for depth-first traversal with logging and error handling.pysnippets/Traversal/iterative_deepening.py
: Implemented theiterative_deepening_search
function combining the benefits of DFS and BFS with logging.Data Structures:
pysnippets/Traversal/data_classes.py
: Introduced data classesNode
,Graph
, andSearchResult
to represent graph structures and traversal results, along with theNodeColor
enumeration for node states.Logging Configuration:
pysnippets/Traversal/logger_config.py
: Set up a logger configuration with console and optional file output to facilitate debugging and monitoring of algorithm execution.Testing:
pysnippets/Traversal/test_all.py
: Added unit tests to validate the functionality of the traversal algorithms, including tests for weighted graphs, node coloring, and handling invalid inputs.TESTING
@UTSAVS26 kindly review this PR