-
Notifications
You must be signed in to change notification settings - Fork 0
Max flow improvement #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Fixed incorrect network.to_graph() method call in basic.md - Replaced basic Clos fabric test with proper hierarchical blueprint tests - Renamed test_api_docs.py to test_doc_generation.py for clarity - All documentation tests now correspond exactly to actual examples - All 421 tests passing with 93.53% coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances the max flow analysis capability in the ngraph library by introducing detailed analytics via the FlowSummary, additional helper functions for sensitivity analysis and bottleneck identification, and updated documentation and examples.
- Enhanced calc_max_flow to optionally return elaborate flow analytics and the flow graph.
- Added new helper functions (saturated_edges, run_sensitivity) for sensitivity and bottleneck analysis.
- Updated test coverage and documentation examples to demonstrate the new analysis capabilities.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_tutorial_docs.py | Added tests for tutorial examples and network configuration |
| tests/test_reference_docs.py | Updated tests for API/docs examples with new max flow features |
| tests/lib/algorithms/test_max_flow.py | Extended unit tests for calc_max_flow and helper functions |
| ngraph/lib/algorithms/types.py | Introduced immutable FlowSummary data structure |
| ngraph/lib/algorithms/max_flow.py | Updated max flow implementation to support detailed analytics |
| docs/reference/api.md | Updated API docs to include new flags and helper functions |
| docs/reference/api-full.md | Updated full API reference including FlowSummary details |
| docs/examples/basic.md | Added advanced analysis section with sensitivity analysis examples |
Comments suppressed due to low confidence (1)
tests/lib/algorithms/test_max_flow.py:183
- [nitpick] Consider renaming the fixture 'line1' to a more descriptive name (e.g., 'simple_graph') to improve readability and clarity in the tests.
def test_max_flow_return_summary_basic(self, line1):
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ BugBot reviewed your changes and found no bugs!
Was this report helpful? Give feedback by reacting with 👍 or 👎
This pull request introduces enhancements to the
calc_max_flowfunction. These changes enable sensitivity analysis and bottleneck edge identification.Enhancements to
calc_max_flowand related utilities:return_summaryandreturn_graphflags tocalc_max_flow, enabling the function to return aFlowSummaryobject with detailed analytics and/or the mutated flow graph. The return type now supports multiple formats based on these flags.saturated_edgesto identify bottleneck edges andrun_sensitivityto perform sensitivity analysis on edge capacities. These utilities provide deeper insights into capacity bottlenecks.FlowSummarydata structure: Introduced an immutableFlowSummaryclass to encapsulate edge flows, residual capacities, reachable nodes, and min-cut edges.Updates to documentation and examples:
docs/examples/basic.mddemonstrating sensitivity analysis and bottleneck edge identification.docs/reference/api-full.mdto pick up new functionality.docs/reference/api.mdto includesaturated_edgesandrun_sensitivityusage.These changes make
ngraphlibrary more suitable for advanced network flow analysis. Close #16