You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initial Commit: Add algorithms to determine peripheral and farthest nodes in a weighted graph
- Implemented Floyd-Warshall algorithm to calculate all-pairs shortest paths,
supporting positive edge weights for weighted graphs.
- Added functions to identify peripheral and far nodes:
- `find_peripheral_node`: Determines the node with maximal eccentricity.
- `find_far_node`: Finds the node with maximal farness, summing shortest-path distances.
- Included error handling for non-positive edge weights, with appropriate ValueError raising.
- Developed extensive test cases using doctests:
- Covered single-node, fully connected, sparse, cyclic, directed acyclic, and
disconnected graphs.
- Validated handling of edge cases including zero and negative weights.
- Ensured code meets PEP 8 standards and passed all lint checks with `ruff`.
- Provided detailed module-level docstring with explanations of algorithms,
complexity, and example applications.
This commit provides foundational functionality for graph-theoretical analysis
and sets up for future expansions or integrations.
0 commit comments