Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test and docs update on Ford Fulkerson Max Flow Min Cut algorithm
- Loading branch information
Showing
9 changed files
with
128 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Max-Flow-Min-Cut | ||
================ | ||
|
||
MaxFlow MinCut (Ford-Fulkerson) | ||
------------------------------- | ||
|
||
.. code-block:: python | ||
from pyalgs.algorithms.graphs.max_flow import FordFulkersonMaxFlow | ||
network = create_flow_network() | ||
ff = FordFulkersonMaxFlow(network, 0, 7) | ||
print('max-flow: '+str(ff.max_flow_value())) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
:license: BSD, see LICENSE for more details. | ||
""" | ||
|
||
__version__ = '0.0.5' | ||
__version__ = '0.0.6' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import unittest | ||
|
||
from pyalgs.algorithms.graphs.max_flow import FordFulkersonMaxFlow | ||
from tests.algorithms.graphs.util import create_flow_network | ||
|
||
|
||
class FordFulkersonMaxFlowUnitTest(unittest.TestCase): | ||
def test_max_flow(self): | ||
network = create_flow_network() | ||
ff = FordFulkersonMaxFlow(network, 0, 7) | ||
print('max-flow: '+str(ff.max_flow_value())) | ||
self.assertEqual(28, ff.max_flow_value()) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters