| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a test to catch importing aliases.
* Add test for another bad import pattern.
* Fix one bad import pattern.
Adds __all__ to some modules where it was missing.
* use `from ... import` in all __init__ imports
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Default to NumPy for simrank_similarity
* fix typo: targete -> target
* arg G left out of call to simrank_similarity
* Fix
* More
* Add pre/post processing of nodes in simrank_similarity
Added test for noninteger nodes
Added and updted examples in docstrings
cleaned up some tests
* parametrize tests so new _python version tested
* Move similarity_numpy code to private function
so deprecating requires very little code change.
* implement changes from the discussion
Move warning so doesn't show unless _numpy() version called
Add test of difference between python and numpy version
Add exception when methods don't converge
Add tests of convergence exception
Remove _is_close function
* increase maxiterations and error handling including for isolated nodes
* black
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use scipy to compute eigenvalues
* Compute svd instead
* Clean up
* Document changes
* Update test_hits to look at convergence failing
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
|
|
| |
and deprecate adj_matrix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add special processing of `multigraph_input` upon graph init
Fixes: #4720
Adding a keyword argument `multigraph_input=True`
to a graph construction call should treat any incoming input data for
the graph as a dict-of-dict-of-dict multigraph data structure.
Previously the multigraph_input argument would be added to the graph
attribute dict and ignored when processing the input data.
* Change default and add tests
* make default try mgi=True, and if fails try mgi=False
* copy parameter docstring to main class
|
|
|
|
|
|
|
|
|
| |
communicability_betweenness_centrality (#4843)
* Remove unued `normalized` parameter from communicability_betweenness_centrality
* dd API change to release_dev.rst
* add tests for small graphs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add info about testing and examples
* Update CONTRIBUTING.rst
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Document testing
* Incorporate feedback
* Cleanup
* rst nit.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
|
|
|
|
|
|
|
|
| |
* Add a test to catch importing aliases.
* Add test for another bad import pattern.
* Fix one bad import pattern.
Adds __all__ to some modules where it was missing.
* RM networkx namespace test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* external -> internal gallery link.
* Add section on NXEPs.
* Go through PRs and add to release notes.
* go through release_dev -- add some "improvements"
* Apply suggestions.
Co-Authored-By: Jarrod Millman <jarrod.millman@gmail.com>
* Apply suggestions.
Co-Authored-By: Jarrod Millman <jarrod.millman@gmail.com>
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add back line coll. style drawing and encapsulate.
Adds back drawing edges via LineCollection that was removed in
#4360.
Encapsulates the two different drawing methods in internal
functions; one for FancyArrowPatches and one for LineCollection.
* WIP: add new kwarg, mv up fn defns.
* apply axis scaling to both edge drawing fns.
* use fancy arrow patch for digraphs + arrow=True (default).
* draw selfloops even for undirected graphs.
* TST: Add test for desired behavior of arrows kwarg.
Tests 3-way switching between default behavior, forcing
fancy arrow patches, and forcing line collections.
* Implement 3-way behavior switch w/ arrows kwarg.
Co-Authored-By: Dan Schult <dschult@colgate.edu>
* Update docstring and add example.
* Fix docstring
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Refactor testing utilities
Change `assert_edges_equal`, `assert_graphs_equal`, and `assert_nodes_equal`
to be more pytest-idiomatic.
For example, `assert_edges_equal` becomes the Boolean function `edges_equal`
and then the assert is done the testing file
(i.e., `assert edges_equal(edges1, edges2)`).
This also makes these utility functions useful in nontesting situations
where you want to compare edges, but not raise an exception based on the result.
* Move testing utility functions
* Use new testing utilities
* Deprecate assert_*_equal testing utilities
* Document node, edge, and graph equality helper functions
* text nits.
* Update networkx/tests/test_convert_pandas.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/readwrite/tests/test_sparse6.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/readwrite/tests/test_graph6.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/generators/tests/test_classic.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/tree/tests/test_operations.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/tree/tests/test_coding.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/tests/test_dag.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/minors/tests/test_contraction.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* add short equality description to docstring
* Suppress known warnings
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix 3 broken refs in nxep2.
* Fix see also link to average_neighbor_degree.
* rm ref to neighbor_connectivity.
* Fix links to bipartite sets and is_bipartite from centrality.
* Fix links to square_clustering.
|
|
|
| |
Use pytest directly instead.
|
| |
|
| |
|
|
|
|
|
| |
* Use pytest.approx
* Deprecate almost_equal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* WIP: adding getattr to nx_yaml module.
* WIP: Tests that informative exceptions raised.
* Add tests for informative messages.
* Add getattrs to higher-up pkgs.
* Remove test_yaml.py
* Remove pyyaml from requirements.
* Update examples in warning messages.
Ensure they are correct, runnable examples.
* Add security warning and removal time to message.
* Cp __getattr__ to other mods/pkgs.
* Update deprecation notes w/ getattrs.
* Remove yaml section from docs.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* handle nan/inf for gml files
* handle nan/inf for gml files
* ran black
* Better fix for nan/inf.
* add tests for special floats in gml.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* Link to guides
* Shorten names
* Simplify menu
|
|
|
|
|
|
|
|
|
| |
graphs (#4659)
Adds an initial_graph parameter to allow users to specify a base graph to
the BA and dual BA genertors.
Co-authored-by: Ludovic Stephan <ludovic.stephan@ens.fr>
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
|
|
|
|
|
|
| |
Adds a topological_generations function and refactor topological_sort
to yield from topological_generations.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* restructured networksimplex.py and added test_networksimplex.py
* formatting changed
* formatting changed
* formatting changed
* removed extra underscore
* added fixture in test_networksimplex.py
* formatting changed
* initilized -> initialized.
* fix typo in comment
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
|
|
|
|
|
|
|
|
| |
default (#4812)
* implement nstart for scipy version of hits
* deprecate python impl and use scipy one by default
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Deprecate attrs dict in json_graph.tree fns.
Replace attrs dict in signature with explicit kwargs and
add deprecation warning.
Adds tests that the behavior isn't changed and that warnings are
raised when expected.
* Add deprecations to list and ignore warnings in conftest.
* Modify cytoscape functions attrs deprecation.
* Cleanup cytoscape test suite.
|
|
|
|
|
| |
Co-authored-by: erbeusgriffincasper@gmail.com
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Move credit to dev guide
* Simplify menu
* Reclaim empty sidebar space
* Simplify release log
* Cleanup bibliography
* Clean up
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* adds implementation of SNAP summarization algorithm
Thanks to dschult and rossbar for many much-needed recommendations for refining and optimizing the implementation
* Seed layouts for snap gallery examples.
Make sure the layouts are reproducible.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add greedy algorithm for solving TSP
Many problems of Combinational Optimization can be represented as graphs.
These problems have enormous significance in many aspects of science, but there are not any algorithms to solve some of them in polynomial time. However many, heuristic and metaheuristic algorithms have been published over the past years in order to solve / approximate the solutions to these problems.
The purpose of this commit is to add implementation of such algorithms for solve one of the most famous problems of Combinational Optimizations, Travelling Salesman Problem (TSP). A greedy algorithm has been implemented at the moment for this reason. "applications" package has been created which include modules that represent a problem. Each module contains several algorithms for solving the specific problem.
At this commit, tsp.py module is added which contains greedy_tsp()
function; a implementation of a greedy algorithm.
* Fix example error
* Trivial changes
List of changes:
Removal of unnesecary _is_weighted() function
Improvements on documentation
* Add applications package to setup.py file
* Change output of greedy algorithm
Algorithm's output is a list of nodes now
* Add simulated annealing algorithm
Add a metaheuristic local search algorithm for solving TSP
* Minor changes
* Fix example doc errors
* Compatible with python 3
* Move tsp module to algorithms package
* Code improvements
* Handle small graphs and fix doc examples
* Documentation changes and rename variables
* Adds Threshold Accepting algorithm for TSP
* Implemented maximal matching of minimal weight and created test suite.
* Removed useless print
* Implemented Christofides.
* Coding was missing
* Add more general traveling_salesman_problem using christofides
Also reconfigure import structure and remove min_weight_matching from
module since it is now in matching.py
* Add new functions to the docs and minor typos
* pep8 fixes
* fix pep8 and change .gitignore
* Add tests of the approximation namespace
update docs in approximation/__init__.py
* Fix is_matching to check if edges in G. Other tweaks:
doc changes
and put not_implemented_for on find_matching functions
* Improve is_matching selfloop handling and expand tests
* Move tsp to approximation directory. Apply black.
* Move tsp tests to approximation tests folder
* Attempt to bring tsp up to current code.
* commit pep8 that my black didnt change, but pep8speaks did find. ??
* tweak a few things and run black
* combine #4083 and #3585 into traveling_salesman.py
* Match chistofides output to other tsp functions
and adjust calling syntax of tests
tweak docs
tweak see also section
* Put big-O complexity in in-line math env.
Prevents sphinx from trying to do variable substitution between
pipes.
* Minor touchups to christofides docstring.
* RST touchups to tsp module docstring.
* Rm extra string from tsp module.
* Docstring touchups for traveling_salesman_problem.
* rst fixups for greedy_tsp docstring.
* rst formatting for simulated annealing docstring.
* More math in-lining for simulated annealing docstring.
* rst and minor grammatical fixes to TA docstring.
* Fix path-finding and test all methods for tsp function
* the refactoring was incomplete. Now maybe is
- Add tests of TSP with all methods.
- Refactor tests to match simulated_annealing tests and threshold tests.
- Unify treatment of weight so unweighted edges use default weight 1.
weight now defaults to "weight" with a default value of 1.
- Rename tolerance to max_iterations (tolerance is used for error bound)
- Rename iterations to N_inner (each iteration takes this many inner loops)
- Introduce idioms like `pairwise` and `cycle.copy()` (over cycle[:])
- Allow passthrough of method kwargs for traveling_salesman_problem
Still need to:
- add test of case where path is more than one edge less that cycle
(incomplete_graph)
- require cycle input (maybe make default list(G)??)
- consider the complexity claims in the doc_strings
* More api changes to TSP functions
- `chritofides` now allows (and ignores) selfloops
- `move` can be a function as well as "1-1" and "1-0"
- `method` for traveling_salesman_problem must have 2 arguments
instead of passing kwargs. User must "curry" to set parameters
- changed doc_string typos in matching.py
* Add test to check that cycle=False can remove many edges
* Change init_cycle api to require input from user
The idea is to make the user specify the initial cycle to start from
rather than relying on the programmers default of a greedy algorithm.
To easy usage, I check for a string "greedy" as a shortcut.
* Update docs with more correct complexity info.
* Check for complete graph now more efficient and selfloops ignored
* merge is_matching changes
Co-authored-by: Thodoris Sotiropoulos <theosotr@windowslive.com>
Co-authored-by: Luca Cappelletti <cappelletti.luca94@gmail.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
| |
* fix urllib import
* update urllib import
|
|
|
| |
Make igraph plotting example render in gallery
|
| |
|
| |
|
|
|
|
|
| |
* Update documentation dependencies
* Speed up theme
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#4769)
* [auto-margin scaling in draw_networkx_nodes function]
* added optional margins arg to draw_networkx_nodes
* updated draw_networkx_nodes margins docstring
* Removed unnecessary import in draw_networkx_nodes
* Update networkx/drawing/nx_pylab.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Improve draw_networkx_nodes margins docstring
Co-authored-by: Dan Schult <dschult@colgate.edu>
* unpacking logic for *margins
* quick fix on margins logic
* Update draw_networkx_nodes margins docstring
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* draw_networkx_nodes docstring update
* draw_networkx_nodes docstring update
* Update draw_networkx_nodes margins control flow
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
| |
When running the test suite, there are new deprecation warnings
about invalid escape sequences.
This is from LaTeX math in some docstrings, which often feature
backslashes.
The simplest way to get rid of these warnings is to convert the
docstrings into raw strings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added images to the generate graph
* Cleaned up comments
* Added comment for node addition
* Ross's suggestion
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Ross's suggestion
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Ross's suggestion
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Ross's suggestion
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* revised code
* added comment
* Update examples/drawing/plot_mpl_annotations.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update examples/drawing/plot_mpl_annotations.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Rename plot_mpl_annotations.py to plot_custom_node_icons.py
Co-authored-by: Alex <a.c.walker@student.tudelft.nl>
Co-authored-by: Sharwin Bobde <31354242+sharwinbobde@users.noreply.github.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Sharwin Bobde <bsharwin@gmail.com>
|
| |
|
| |
|