summaryrefslogtreecommitdiff
path: root/networkx/algorithms/approximation/connectivity.py
Commit message (Collapse)AuthorAgeFilesLines
* Rm unreachable code for validating input (#6675)Ross Barnowski2023-05-011-6/+0
| | | Rm un-hittable validation lines.
* Lint using Ruff (#6371)danieleades2023-02-191-1/+1
| | | | | | | | | | | | | | | * lint and fix using ruff * add flake8-pie lints * remove useless import alias * bump version * bump deps --------- Co-authored-by: daniel.eades <daniel.eades@hotmail.com>
* Added an example in all_pairs_node_connectivity (#6126)Paula Pérez Bianchi2022-11-011-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | * add missing reference in all_node_cuts flow_func parameter * added example to all_pairs_node_connectivity * Update networkx/algorithms/approximation/connectivity.py Added suggestion Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Update networkx/algorithms/approximation/connectivity.py added pprint Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * Update networkx/algorithms/connectivity/kcutsets.py fix linking Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> * solved style problems Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Minor improvements from general code readthrough (#5414)Ross Barnowski2022-03-251-3/+1
| | | | | | | | | | | | | * Add deprecated directive to reversed docstring. * Add missing dep directives to shpfiles. * Remove defn of INF sentinel. * typo. * str -> comment in forloop. * STY: appropriate casing for var name.
* Format w/ black==20.8b1Jarrod Millman2020-10-061-1/+1
|
* Format w/ blackJarrod Millman2020-07-101-6/+10
|
* Upgrade to Py36 syntaxJarrod Millman2020-01-011-1/+1
| | | | find networkx -name \*.py -exec pyupgrade --py36-plus {} \;
* Convert %-format to fstringJarrod Millman2020-01-011-3/+3
|
* Remove boiler plate from top of modulesJarrod Millman2019-11-111-6/+0
| | | | | | | | | The copyright and author stuff is not necessary, out-of-date, and inconsistent. It takes up visual space and is a pain to police everyone doing the same thing on the top of the module. Git handles authorship in a comprehensive and authoritative way. The LICENSE.txt file applies to all project code.
* Fix more documentation issues with exceptionsJarrod Millman2019-11-091-1/+1
|
* PEP8 fixesJarrod Millman2019-10-181-29/+29
|
* Fix typo in doctring (#3568)Salim BELHADDAD2019-09-041-1/+1
|
* Replacing `Return` to `Returns` in docs for functions (#3301)Moradnejad2019-02-181-1/+1
| | | | | | * Fixed problem in documentation view of this function * Replacing `Return` to `Returns` in function docs
* Misc. typos (#2872)luzpaz2018-02-141-2/+2
| | | | | | | | | | Found via `codespell -q 3 -I ../networkx-whitelist.txt` where whitelist consisted of: ``` ans childs iff nd te ```
* Pep8 fixesJarrod Millman2018-01-201-13/+14
|
* Fixes for k-components tests and node connectivity approximation doctests (#5)Jordi Torrents2017-04-021-7/+7
| | | | | | | | | | | | | | | | * Use octahedral instead of icosahedral for connectivity approx docs. The approximation algorithm for node connectivity fails on the icosahedral graph depending on node iteration order. We use the octahedral graph instead as example in the docstrings. * Fix k-components tests avoiding hard-coded node labels. In order to support the new dict implementation of python 3.6 we have to avoid hard-coding node labels for the k-components of the example graphs in k-components tests. We now test the number of k-components found, their number of nodes, and their node connectivity to make sure that the algorithms are correct.
* Uses chain instead of chain.from_iterable.Jeffrey Finkelstein2015-11-161-2/+1
|
* Remove degree_iter(),now degree() returns an integer for single node and ↵Mridul Seth2015-06-271-1/+1
| | | | iterator for else
* Merge pull request #1589 from MridulS/succprediterDan Schult2015-06-171-4/+4
|\ | | | | Remove successors_iter() and predecessors_iter(). G.successors() and G.predecessors() now return iterators instead of lists
| * Remove successors_iter() and predecessors_iter(). G.successors() and ↵Mridul Seth2015-06-121-4/+4
| | | | | | | | G.predecessors() now return iterators instead of lists
* | Remove neighbors_iter, G.neighbors() now returns an iterator instead of listMridul Seth2015-06-121-3/+3
|/
* Use a positional argument for the container of nodes to exclude.Jordi Torrents2015-03-151-8/+5
| | | | | There is no need of a keyword argument for the container in the auxiliary function `_bidirectional_shortest_path`.
* Clarify cutoff parameter in the docstrings.Jordi Torrents2015-03-151-3/+6
|
* Add fast approximation for node connectivity.Jordi Torrents2015-03-141-0/+405
This PR adds White and Newman's fast approximation algorithm for finding node independent paths between two nodes. It finds them by computing their shortest path using BFS, marking the nodes of the path found as used and then searching other shortest paths excluding the nodes marked as used until no more paths exist. It is not exact because a shortest path could use nodes that, if the path were longer, may belong to two different node independent paths. Thus it only guarantees an strict lower bound on node connectivity. This implementation uses a modified version of `bidirectional_shortest_path` that accepts the extra parameter 'exclude', which is a container for nodes already used in other paths that should be ignored.