summaryrefslogtreecommitdiff
path: root/networkx/algorithms/components/connected.py
Commit message (Collapse)AuthorAgeFilesLines
* Dispatch more BFS-based algorithms (#6467)Erik Welch2023-03-111-0/+2
|
* plugin based backend infrastructure to use multiple computation backends (#6000)Mridul Seth2022-11-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Wrappers classes to dispatch to a backend * Rework the backend dispatching - Use __networkx_plugin__=name to find graph-like objects instead of subclassing - Add PluginInfo to smooth over differences in importlib.metadata across python versions - Add dispatch behavior override via environment variable to aid in testing plugins * Dispatch more algorithms and improve auto-test capabilities * Allow dispatcher decorator without a name - Name is taken from the decorated function - Raise error if backend doesn't implement a decorated function which is called - Check for duplicate names for dispatching algorithms * Make sphinx pick up backend docs * make black happy * Rename decorator to _dispatch as it's experimental * A few more dispatched functions * Make convert to and from methods for auto-testing - Rename `convert` to `convert_from_nx` - Add `convert_to_nx` function These will allow backends to return native objects when dispatching, but provide a mechanism to convert the result to the type expected by NetworkX tests for the auto-test plugin mechanism. * More dispatching * Include name with `convert_**_nx` methods * Remove known plugin names This check is not needed, as any plugin can register itself in the entry points section. The dispatching and auto-testing explicitly specify the plugin to use, so there is no need to hardcode the options. These were originally included for security, but any malicious actor would simply use one of the valid names, so having a hardcoded list does not actually provide any meaningful security. * Add `dispatchname` to dispatchable functions Co-authored-by: Jim Kitchen <jim22k@gmail.com> Co-authored-by: Erik Welch <erik.n.welch@gmail.com>
* Use isort with pre-commit to enforce import guidelines (#5659)Mridul Seth2022-06-021-0/+1
| | | | | * Add isort to pre-commit * Run isort on all python files (except __init__.py ones)
* Added examples in connected and strongly connected functions (#5559)Nikita Sharma2022-05-091-0/+12
| | | | | | | | | * added examples * Update networkx/algorithms/components/connected.py Co-authored-by: Ross Barnowski <rossbar@berkeley.edu> Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Format w/ blackJarrod Millman2020-07-101-9/+10
|
* Fix example in docstring (#3866)Rüdiger Busche2020-03-151-1/+2
| | | Co-authored-by: rbusche <rbusche@inserve.de>
* Make connected_components safe to component set mutation (#3859)Kelly Boothby2020-03-091-4/+4
| | | | | | | | | * added test for issue 3823 * fixed (networkx #3823) * minor performance tweak * pep8
* Remove superfluous encoding informationJarrod Millman2019-11-111-1/+0
|
* Remove boiler plate from top of modulesJarrod Millman2019-11-111-10/+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-3/+3
|
* Remove unused importsJarrod Millman2019-10-181-1/+0
|
* Remove deprecated functions and methods. add to release notes.Dan Schult2019-10-121-17/+3
|
* Update copyrightJarrod Millman2019-03-301-1/+1
|
* Replacing `Return` to `Returns` in docs for functions (#3301)Moradnejad2019-02-181-3/+3
| | | | | | * Fixed problem in documentation view of this function * Replacing `Return` to `Returns` in function docs
* Update copyrightJarrod Millman2018-01-201-1/+1
|
* Deprecate component_subgraphs functions (#2819)Dan Schult2018-01-091-45/+10
| | | | | | | | | * Deprecate component_subgraphs functions Resolves #1431 * Fix antigraph error introduced in connected_components * Add tests of null graph to component functions and avoid lists when counting
* Correct when we raise NetworkXNotImplemented (#2731)gfyoung2017-11-021-3/+3
| | | algorithms/components/connected.py was littered with incorrect descriptions that we raise NetworkXNotImplemented for undirected graphs, when we meant to say directed.
* Some changes to reduce the really long parts of tests (#2561)Dan Schult2017-08-021-1/+2
| | | | | | | | * adjust some of the slowest tests. minor speedup of is_connected. * Add adj property to AntiGraph class in kcomponents.py * Add comment to explain why test loop only goes once
* Update copyrightJarrod Millman2017-07-251-1/+1
|
* Minor correction in documentationAllen Downey2016-07-061-1/+1
|
* Correct see also linksMichael-E-Rose2016-04-201-10/+10
|
* Format/Correct/Extend docstrings and update top of modulesMichael-E-Rose2016-04-161-9/+37
|
* Change all X.add_path yp nx.add_path(X,Dan Schult2016-02-021-1/+1
|
* Use peek(S) instead of next(iter(S)).Jeffrey Finkelstein2015-07-171-1/+2
| | | | | | | | | | As of the date of this commit, there is no way to get an arbitrary element of an iterable like a set without modifying it (for example, as in `set.pop()`). The `peek()` function is more readable than writing next(iter(S)) whenever an arbitrary element of an iterable is required.
* Refactor and improve the documentation for connected_components.Jordi Torrents2015-05-071-17/+54
| | | | | | | | | | | | | | Make connected_components a generator of sets of nodes, it was a generator of list of nodes. See #1501 for discussion. Use a plain BFS to compute them instead of using the single source shortest path function. The latter also does a BFS but keeps track of the distances. This is only slightly faster for small graphs (arround 5% in my tests), but for larger graphs the speed up is more relevant (around 1.8x faster). Also I think it's conceptually better. As @ysitu said, we have a tendency to abuse shortest paths functions for reachability. Also improved biconnected components examples, docstrings, and code.
* Fix copyrightsJGab2015-04-211-1/+1
|
* corrected docstringdrevicko2014-07-011-3/+3
| | | The docstring of connected_component_subgraphs() had one parameter (copy=True) listed as a Return.
* Documentation for components change to generator.Aric Hagberg2013-11-241-1/+1
| | | | Addresses #964
* Add example for sorting components by sizeAric Hagberg2013-10-241-0/+9
|
* Connected component subgraphs copyAric Hagberg2013-10-071-92/+70
| | | | | Add option to copy (or not) subgraph data. Rework connected components algorithms as generators.
* Apply patch for copying subgraph data. Addresses #588.Aric Hagberg2011-10-031-1/+3
| | | | This could still use review.
* Even more imports cleanup and exceptions fixed.Loïc Séguin-C.2011-02-101-1/+0
|
* Remove component class code until we settle on design and location.Aric Hagberg2010-11-111-175/+0
| | | | Addresses #457
* Adding class for incrementally tracking connected components.Chris Ellison2010-11-041-1/+177
|
* Minor fixes to documentation, mainly to help Sphinx with one line descriptions.loicseguin2010-08-091-1/+1
| | | | | --HG-- extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401874
* Merging py3k-1.2 branch into trunk. Addresses #348loicseguin2010-08-021-10/+8
| | | | | --HG-- extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401832
* Use standard "import networkx as nx" in all modulesaric2010-04-171-8/+8
| | | | | | | | so we don't need nose test plugin to handle doctest strings in modules. --HG-- extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401706
* Split connectivity algorithms into multiple filesaric2010-04-161-0/+192
--HG-- extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401697