| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes-for-6607
* Update networkx/algorithms/tests/test_euler.py
Co-authored-by: Mridul Seth <mail@mriduls.com>
* Update euler test
---------
Co-authored-by: Mridul Seth <mail@mriduls.com>
Co-authored-by: Mridul Seth <git@mriduls.com>
|
| |
|
|
|
| |
* Fix for is_chordal for empty graphs
* Handle self loops case
|
| |
|
|
|
|
| |
Replace sets with dict keys to make cycle_basis deterministic with respect
to node ordering.
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add tests for nx._dispatch decorator
The dispatch functionality is used to delegate graph
computations to a different backend. Because those backends
are not part of NetworkX, testing the dispatching feature
was not originally added, relying instead on the other
backends (e.g. graphblas-algorithms) to verify the dispatch
functionality is working.
This change creates a "loopback" backend where NetworkX dispatches
to itself for the sole purpose of exercising the dispatching
machinery.
In one incarnation, various tests are augmented to use the
LoopbackGraph family and force loopback dispatching to occur
as normal usage would.
A second incarnation forces *all* tests to run in dispatch mode
but use of a different _dispatch decorator. This mode is triggered
for all of pytest, so it must be tested by the CI system specifically.
* Update CI to hopefully run dispatching auto tests
* Formatting
* More formatting fixes
* Better comments explaining dispatching tests
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add simple cycle enumerator for undirected class
* Implemented Gupta & Suzumura and refactored Johnson in a common form
and unified their call-site. Now, users can enumerate simple cycles
of directed or undireced graphs, with bounded or unbounded length,
all from the same `simple_cycles` function. I abandoned the stretch
goal of enumerating chordless cycles, as they are not gracefully
handled by the algorithms of Johnson nor Gupta & Suzumura.
* updated tests for simple_cycles to include undirected graphs
* * fixed documentation issues, elaborated on algorithm details
* restricted to nontrivial components
* removed specialized DFS to pick edges from undirected components
lemma: if G is a biconnected graph with at least 3 nodes and
e is an edge in G, then e belongs to a cycle
* added tests for undirected and bounded cases for simple_cycles
* added handling for digons in multigraphs
* * Improved support for multigraphs
* Split chordless_cycles out from simple_cycles because the case
analysis got so tricky
* Added enhanced cycle-testing framework to tests for simple_cycles
* Added tests for multigraphs
* Needs more documentation
* * Documented simple_cycles
* Caught incorrectly-handled case of parallel self-loops
* removed chordless option from simple_cycles
* typos/raises/leftovers in docs and error/corner tests
* add a quick example to chordless_cycles
* Add chordless_cycles to docs
---------
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Mridul Seth <git@mriduls.com>
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
| |
* Update developer requirements
* Run linter
|
| |
|
|
|
|
|
| |
* Using create_using
* check edges between cliques
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add examples to find_cliques docstring.
Add some examples to show how to compute various quantities
using the find_cliques generator.
Each of these quantities currently has a dedicated function in the clique
module that could be deprecated in favor of these simple expressions.
* Deprecate graph_clique_number.
* Deprecate graph_number_of_cliques.
* Deprecate number_of_cliques.
* Rm internal use of deprecated functions.
* Deprecated cliques_containing_node.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
contains nodes not in the graph. (#6272)
* Update simple_paths.py
Current version of `is_simple_path` fails with `KeyError` if the first element of the node list is not in the graph.
* Update simple_paths.py
* Update simple_paths.py
Simplify the test condition. Checking for a single node in the list can be combined with checking for duplicates in the list without meaningful efficiency loss.
* Update test_simple_paths.py
Add the case when the start of the path is a node not in the graph.
* Update simple_paths.py
* Update simple_paths.py
* Update simple_paths.py
* Update simple_paths.py
* Update simple_paths.py
Still need to check the special case of a list with 1 item.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* raise exception if graph has less than 2 edges in random_reference and lattice_reference and tested
* Updated lattice_reference doc
* Update networkx/algorithms/smallworld.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/tests/test_smallworld.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Added some suggestions
* Added some final suggestions
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* raise exception if graph has no edges and test for that
* Simplify code: raise exception if G has less than 3 edges
* add correction
* Solved bug in double_edge_swap and added tests for that. Also updated the doc entry
* Update networkx/algorithms/swap.py
* Added some final suggestions
* add merge suggestions
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
| |
Allow MultiGraphs for LCA
|
| |
|
|
|
| |
Rm incorrect test case.
There is a valid edge swap between (0, 1) and (2, 3) for this case.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added Exception test to test_covering.py
* Completed Testing for covering.py
* Added test and style change
* Increased Coverage in test_core.py
* Changed test_covering.py back to main state
* Update networkx/algorithms/tests/test_core.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Deleted warning test
* Deleted unused import
* Apply suggestions to onion_layers as well.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
| |
changed edge weights for max weight matching and added test.
Co-authored-by: Radoslav Fulek <rado@comitycard.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* swap tests added, coverage at 100
* Build from edgelist
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Regex match added to error tests
* F strings removed, comment added
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| | |
|
| |
|
|
|
| |
* Added test for cycle_basis for graphs with self loops.
* sorted the array for comparision
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added Exception test to test_covering.py
* Completed Testing for covering.py
* Added test and style change
* Update networkx/algorithms/tests/test_covering.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Imported pytest, should pass all tests now
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
| |
* Renamed test functions in test_lowest_common_ancestors
* Updated test method names.
* Removed redundant docstrings
* Minor touchups.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
| |
Increased test coverage in is_matching, is_maximal_matching, is_perfect_matching
|
| |
|
|
|
|
|
|
|
| |
* Rm maxcardinality param from min_weight_matching.
* Rm min_weight_matching test with cardinality.
* Rm maxcardinality param from christofides implementation.
* Improve clarity of neg wt matching test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tests (#5988)
* Fix weighted MultiDiGraphs in dag longest path algorithms
* Add tests for MultiDiGraphs in dag longest path tests
* Test non default default_weight
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Test non default default_weight
* blackify
Co-authored-by: Mridul Seth <mail@mriduls.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Mridul Seth <git@mriduls.com>
|
| |
|
|
|
| |
* improved test coverage for richclub.py
* improved test coverage for richclub.py
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Ran black
* Add unit tests
* Rename and fix citation
* Black
* Fix unite tests
* Isort
* Add algo description
* Update networkx/algorithms/tests/test_d_separation.py
* Update networkx/algorithms/traversal/breadth_first_search.py
* Address dans comments
* Fix unit tests
* Update networkx/algorithms/tests/test_d_separation.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Apply suggestions from code review
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Update networkx/algorithms/dag.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Update networkx/algorithms/dag.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Fix comments
* Clean up the docs a bit more
* Merge
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* WIP: Replace functions to evaluate tests.
* Raise prompt exceptions by wrapping generator.
* Fix erroneous ground-truth self-ancestor in tests.
* Move pair creation outside of generator and validate.
* Convert input with fromkeys to preserve order and rm duplicates.
* Replace LCA implementations & update tests.
* Test cleanup: move new tests into old class.
Allows us to get rid of duplication/another test setup.
* Rm naive fns from refguide.
* Add release note.
* Remove unused imports.
* Remove missed duplicate function (bad rebase).
Co-authored-by: Dilara Tekinoglu <dilaranurtuncturk@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
Adds the weight keyword argument to allow users to compute weighted distance metrics
e.g. diameter, eccentricity, periphery, etc. The kwarg works in the same fashion as the
weight param for shortest paths - i.e. if a string, look up with edge attr by key, if callable,
compute the weight via the function. Default is None, meaning return unweighted result
which is the current behavior.
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fixed unused root argument in has_bridges
* Verify if root is in graph in chain_decomposition function
* Fix bridges function returning only bridges in connected component of root
* Apply suggestions from code review
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Apply suggestions from code review
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Fix bridge test when root is not in G
* Rewrite code to make it more readable
* Add missing tests for chain decomposition and bridges
* Apply suggestions from code review
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Apply suggestions from code review
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add naive lca methods
* Naive algorithm implementation for LCA
* Modify naive lca functions
* Correct parameters of nx.ancestors
* Update lowest_common_ancestors.py
* Parametrize tests
* Apply suggestions from code review
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Yield instead of append
* Tests for naive lca
* Correct test cases for naive lca algorithms
* Apply suggestions from code review
Co-authored-by: Mridul Seth <mail@mriduls.com>
* Fix function name -when calling
* Make requested changes
* Inlining _get_a_lowest_common_ancestor
Co-authored-by: dtuncturk <dilaramemis@sabanciuniv.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Mridul Seth <mail@mriduls.com>
|
| |
|
|
|
|
| |
Removes the deprecated OrderedGraph classes.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add tests for directed edge swap
* Add directed edge swap algorithm
* Allow more swaps in directed tests
* Fix errors in swap.py to meet test criteria
* Remove TODOs
* Update documentation for directed_edge_swap and run black
* Fix incosistent spacing
* Add references
* Added PR to release docs
* Fix reference formatting
* Improve documentation
* An -> A
* Update networkx/algorithms/swap.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Add 'Raises' section to documentation
* Update tests to use keyword arguments for directed_edge_swap
* Fix references to 'triple-edge' swap
* Use not_implemented_for decorator for directed_edge_swap
* Rename n to tries and remove unnecessary updates
* Rename e to msg
* Use 'succ' instead of 'out_edges' for getting successors
* Update networkx/algorithms/swap.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Update networkx/algorithms/tests/test_swap.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Update networkx/algorithms/tests/test_swap.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Update networkx/algorithms/tests/test_swap.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Update networkx/algorithms/swap.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Convert gnp graphs to path graphs for clarity
* Use seed when testing directed edge swap
* Check node equality sooner
* Add directed_edge_swap to documentation
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| |
|
|
|
|
|
|
| |
* Remove pyyaml dependency
* Make mypy happy.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Mridul Seth <seth.mridul@gmail.com>
|
| |
|
|
|
| |
* Remove deprecated function extrema_bounding
* remove functions from TOC
|
| |
|
|
|
|
|
| |
* Replace node_classification subpackage with a module
* update node_classification doc reference
* remove node_classification from setup.py
|
| |
|
|
|
| |
Make chordal_graph_cliques a generator
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| | |
|
| |
|
| |
Adds chromatic_polynomial function to the graph polynomials package.
|
| |
|
|
|
|
|
|
|
|
|
| |
* MAINT: clean up maximal_independent_set tests a bit
* Update networkx/algorithms/tests/test_mis.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* STY: fix black complaint.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
| |
* Add isort to pre-commit
* Run isort on all python files (except __init__.py ones)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* More tests for clustering
These improve coverage of `graphblas-algorithms`.
Also, some floating point comparisons were relaxed to use `np.testing.assert_allclose`.
I take a narrow approach with this: I only relax the comparisons needed to allow
`graphblas-algorithms to pass tests.
* Better (thanks pytest-randomly!)
* And more tests for generalized_degree
* Add code comment based on feedback
* Drop unnecessary `.0` in test_cluster.py via `s/\.0\>//g`
|
| |
|
|
|
|
|
|
|
| |
* Remove redundant float conversion
* Remove redundant int conversion
* Use integer division
Co-authored-by: Miroslav Šedivý <6774676+eumiro@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add traid_census tests for short paths w and w/o nodelist
* triad_census with single node nodelist inputs work
* Expand to allow nodelists bigger than 1 node
* test selfloops, raise ValueError if duplicate nodes or nodes out of G
* remove extraneous imports
* wording update.
* Add msg checking to exception msg test.
* Remove slow test for triads of small graphs
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Disallow isolated nodes for Eulerian path & make related doc_string change
* Remove test for directed graphs with isolated nodes
* Fix syntax error in examples
* Restore deleted tests for euler path
* Fix assertion error
* Fix typo
* Update networkx/algorithms/euler.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update release_dev.rst
Co-authored-by: dtuncturk <dilaramemis@sabanciuniv.edu>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
| |
* fix defect in non-bipartite case while maintaining questionable bipartite output
* Update docs to correctly describe the current behavior of min_edge_covering
* rename the added test
|
| |
|
|
|
|
|
|
|
| |
* a hack to force self edges to be ignored on the first node inspected
* move test into test class to resolve cicd pipeline issue
* stupid mistake
Co-authored-by: Sheldon Hall <sheldon.hall@touchsurgery.com>
|
| |
|
|
|
|
|
| |
* Add test and then fix code and docs
* Correct and improve docs. Change 1e-6 to 1 to maintain integers.
Include argument in docstring for why adding the 1 doesn't impact the min
|