| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
| |
Improve_test_coverage_cfc.py
|
| |
|
| |
Fix links in see also section of docs
|
| |
|
| |
Fix links in See Also section
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
| |
(#6380)
|
| |
|
| |
Minor formatting fixups to get rid of doc build warnings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* first commit, start testing
* rename
* formatting with black
* formating example based on testing failure
* deleting example from docstring
* rewriting example based on eigenvector.py
* rewrite docstring for other supplementary functions
* formating with black
* deleting custom scipy function
* rewriting matrix manipulation
* rewriting nbunch iteration based on review
* rewriting dictionary update
* update directed_laplacian_matrix_args params
* rewriting docstring based on comments
* update docstring
* update docstring with Laplacian energy def
* update docstring
* bringing package imports into the function
* adding laplacian.py to needs_numpy and needs_scipy tests
* addig Laplacian centrality to centrality.rst
* formatting with black
* dictionary update fix
* beatify docstring
Co-authored-by: Dan Schult <dschult@colgate.edu>
* beatify docstring
Co-authored-by: Dan Schult <dschult@colgate.edu>
* beatify docstring
Co-authored-by: Dan Schult <dschult@colgate.edu>
* beatify docstring
Co-authored-by: Dan Schult <dschult@colgate.edu>
* beautify with black
* add ** to kwargs in function
* add test file for local testing
* black test file
* black
* replace nx.laplacian to direct import
* adding pytest importskip and formating with black
* adding laplacian centrality to the init file
* changing import from direct to nx.laplacian
* rewriting output for non-normalized option
* rewriting tests using functions instead of class structure
* mod with black
* formating
* formating
* directed and undirected laplace and eigen values correction
* black formating
* adding asfptype for sparse eig solver and format with black
* change from sparse solver to dense solver
* change back A_2 eigval solver
* format with black
* black
* change back to previous state
* change back to previous state
* new eigh func
* fix eighvals func
* adding laplacian matrix parameters
* change alpha to None
* change back alpha to 0.95
* adding nodeset and ful nodelist objects
* adding nodeset and relevant error message
* solving directed-undirected issue converting everything to sparse matrix
* change line ending
* untrack env files
* isort test file
* adding nodelist and noteset
* black
* change centrality calculation to nodeset instead of full nodelist
* added comment
* eigh_f func to one-liner
* move eigh value calculation outside if condition
* simplify row/column by advanced indexing
* simplify row/column by advanced indexing for set diag
* format with black
* wrap doc_string to 88 chars and reword optional keywords.
* handle nodelist and nodeset
* remove casting as a csr_matrix
* covert to dense since we have to for computing the spectrum anyway.
* minor: ease readability
* fix normalization
* add tests for normalized and weight kwargs
* fix black
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Gabor Berei <bereig@starschema.net>
|
| |
|
|
|
| |
* Fix_Typos
* Commit_Suggestions
|
| | |
|
| |
|
|
|
|
|
| |
Fixes: 6226
* Minor formatting fixups.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
betweenness_subset.py #6033 (#6083)
* Updated test_betweenness_centrality_subset.py
* add test of normalized in test_betweenness_centrality_subset.py
* add test of normalized in test_betweenness_centrality_subset.py
* update test of normalized in test_betweenness_centrality_subset.py
* update weight of test_betweenness_centrality_subset.py
* add docstring
* add docstring in test_betweenness_centrality_subset.py
* add docstring in test_betweenness_centrality_subset.py
|
| |
|
| |
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes #6036
* test load centrality
* test dispersion
* test dispersion
* dispersion test
* test dispersion
* bug-fixes-for-issue-6088
* deleted
* bugfix for 6111
* Add suggestion for parameter description.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes #6036
* test load centrality
* test dispersion
* test dispersion
* dispersion test
* test dispersion
* bug-fixes-for-issue-6088
* deleted
* bugfix for 6154
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes #6036
* test load centrality
* test dispersion
* test dispersion
* dispersion test
* test dispersion
* bug-fixes-for-issue-6088
* deleted
* bug-fix-for-issue-6092
|
| |
|
|
|
| |
* fixes #6036
* test load centrality
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Use scipy.sparse array datastructure
* Add reminder to rm wrapper when scipy adds creation fns.
* Rm mention of np matrix from code comment.
* Update networkx/algorithms/bipartite/matrix.py
Co-authored-by: Stefan van der Walt <sjvdwalt@gmail.com>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Stefan van der Walt <sjvdwalt@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
* added example on degree centrality
* added example on in degree centrality
* added example on out degree centrality
* added opening braces
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update distance parameter description.
Update the description of the parameter in the
closeness_centrality function to note that by default, the edge
distances (weights) are assumed to be 1, and that no input
validation is performed.
* Fix styling.
* Update networkx/algorithms/centrality/closeness.py
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Make black happy.
Co-authored-by: Dan Schult <dschult@colgate.edu>
|
| |
|
|
|
|
|
|
| |
* Remove deprecated function edge_betweeness
* [ci skip] remove from release doc validation script.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Mridul Seth <seth.mridul@gmail.com>
|
| |
|
|
|
|
|
| |
Remove betweenness_centrality_source in favor of preferred name,
betweenness_centrality_subset.
Co-authored-by: dtuncturk <dilaramemis@sabanciuniv.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* MAINT: Cleanup centrality module, remove unused variables
* make isort linter happy
* MAINT: make the loop more readable
Co-authored-by: Dan Schult <dschult@colgate.edu>
* make black happy
* Use a different name for internal function variable
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
* rename closeness_cen to closeness_dict
* minor cleanup in current_flow_betweenness and group
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
|
| |
|
|
|
| |
* Add isort to pre-commit
* Run isort on all python files (except __init__.py ones)
|
| |
|
|
|
|
|
|
|
| |
* Remove redundant float conversion
* Remove redundant int conversion
* Use integer division
Co-authored-by: Miroslav Šedivý <6774676+eumiro@users.noreply.github.com>
|
| |
|
|
|
| |
* added example on closeness
* docstring improvement
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add examples & improve documentation of voterank
* Run black for autoformatting
* Fix minor typo
* Change example (add edges from the list instead of one by one)
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Revert to previous wording
* Re-format second example
* minor formatting nits.
Co-authored-by: dtuncturk <dilaramemis@sabanciuniv.edu>
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
|
|
| |
* Fix missing backticks
* one more backticks
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Step 1: use sparse arrays in nx.to_scipy_sparse_matrix.
Seems like a reasonable place to start.
nx.to_scipy_sparse_matrix is one of the primary interfaces to
scipy.sparse from within NetworkX.
* 1: Use np.outer instead of mult col/row vectors
Fix two instances in modularitymatrix where a new 2D array was being
created via an outer product of two \"vectors\".
In the matrix case, this was a row vector \* a column vector. In the
array case this can be disambiguated by being explicit with np.outer.
* Update _transition_matrix in laplacianmatrix module
- A few instances of matrix multiplication operator
- Add np.newaxis + transpose to get shape right for broadcasting
- Explicitly convert e.g. sp.sparse.spdiags to a csr_array.
* Update directed_combinitorial_laplacian w/ sparse array.
- Wrap spdiags in csr_array and update matmul operators.
* Rm matrix-specific code from lgc and hmn modules
- Replace .A call with appropriate array semantics
- wrap sparse.diags in csr_array.
* Change hits to use sparse array semantics.
- Replace * with @
- Remove superfluous calls to flatten.
* Update sparse matrix usage in layout module.
- Simplify lil.getrowview call
- Wrap spdiags in csr_array.
* lil_matrix -> lil_array in graphmatrix.py.
* WIP: Start working on algebraic connectivity module.
* Incorporate auth mat varname feedback.
* Revert 1D slice and comment for 1D sparse future.
* Add TODOs: rm csr_array wrapper around spdiags etc.
* WIP: cleanup algebraicconn: tracemin_fiedler.
* Typo.
* Finish reviewing algebraicconnectivity.
* Convert bethe_hessian matrix to use sparse arrays.
* WIP: update laplacian.
Update undirected laplacian functions.
* WIP: laplacian - add comment about _transition_matrix return types.
* Finish laplacianmatrix review.
* Update attrmatrix.
* Switch to official laplacian function.
* Update pagerank to use sparse array.
* Switch bipartite matrix to sparse arrays.
* Check from_scipy_sparse_matrix works with arrays.
Modifies test suite.
* Apply changes from review.
* Fix failing docstring tests.
* Fix missing axis for in-place multiplication.
* Use scipy==1.8rc2
* Use matrix multiplication
* Fix PyPy CI
* [MRG] Create plot_subgraphs.py example (#5165)
* Create plot_subgraphs.py
https://github.com/networkx/networkx/issues/4220
* Update plot_subgraphs.py
black
* Update plot_subgraphs.py
lint plus font_size
* Update plot_subgraphs.py
added more plots
* Update plot_subgraphs.py
removed plots from the unit test and added comments
* Update plot_subgraphs.py
lint
* Update plot_subgraphs.py
typos fixed
* Update plot_subgraphs.py
added nodes to the plot of the edges removed that was commented out for whatever reason
* Update plot_subgraphs.py
revert the latest commit - the line was commented out for a reason - it's broken
* Update plot_subgraphs.py
fixed node color issue
* Update plot_subgraphs.py
format fix
* Update plot_subgraphs.py
forgot to draw the nodes... now fixed
* Fix sphinx warnings about heading length.
* Update examples/algorithms/plot_subgraphs.py
* Update examples/algorithms/plot_subgraphs.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
* Add traveling salesman problem to example gallery (#4874)
Adds an example of the using Christofides to solve the TSP problem to the example galery.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Fixed inconsistent documentation for nbunch parameter in DiGraph.edges() (#5037)
* Fixed inconsistent documentation for nbunch parameter in DiGraph.edges()
* Resolved Requested Changes
* Revert changes to degree docstrings.
* Update comments in example.
* Apply wording to edges method in all graph classes.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Compatibility updates from testing with numpy/scipy/pytest rc's (#5226)
* Rm deprecated scipy subpkg access.
* Use recwarn fixture in place of deprecated pytest pattern.
* Rm unnecessary try/except from tests.
* Replace internal `close` fn with `math.isclose`. (#5224)
* Replace internal close fn with math.isclose.
* Fix lines in docstring examples.
* Fix Python 3.10 deprecation warning w/ int div. (#5231)
* Touchups and suggestions for subgraph gallery example (#5225)
* Simplify construction of G with edges rm'd
* Rm unused graph attribute.
* Shorten categorization by node type.
* Simplify node coloring.
* Simplify isomorphism check.
* Rm unit test.
* Rm redundant plotting of each subgraph.
* Use new package name (#5234)
* Allowing None edges in weight function of bidirectional Dijkstra (#5232)
* added following feature also to bidirectional dijkstra: The weight function can be used to hide edges by returning None.
* changed syntax for better readability and code duplicate avoidance
Co-authored-by: Hohmann, Nikolas <nikolas.hohmann@tu-darmstadt.de>
* Add an FAQ about assigning issues. (#5182)
* Add FAQ about assigning issues.
* Add note about linking issues from new PRs.
* Update dev deps (#5243)
* Update minor doc issues with tex notation (#5244)
* Add FutureWarnings to fns that return sparse matrices
- biadjacency_matrix.
- bethe_hessian_matrix.
- incidence_matrix.
- laplacian functions.
- modularity_matrix functions.
- adjacency_matrix.
* Add to_scipy_sparse_array and use it everywhere.
Add a new conversion function to preserve array semantics internally
while not altering behavior for users.
Also adds FutureWarning to to_scipy_sparse_matrix.
* Add from_scipy_sparse_array. Supercedes from_scipy_sparse_matrix.
* Handle deprecations in separate PR.
* Fix docstring examples.
Co-authored-by: Mridul Seth <mail@mriduls.com>
Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
Co-authored-by: Andrew Knyazev <andrew.knyazev@ucdenver.edu>
Co-authored-by: Dan Schult <dschult@colgate.edu>
Co-authored-by: eskountis <56514439+eskountis@users.noreply.github.com>
Co-authored-by: Anutosh Bhat <87052487+anutosh491@users.noreply.github.com>
Co-authored-by: NikHoh <nikhoh@web.de>
Co-authored-by: Hohmann, Nikolas <nikolas.hohmann@tu-darmstadt.de>
Co-authored-by: Sultan Orazbayev <contact@econpoint.com>
Co-authored-by: Mridul Seth <mail@mriduls.com>
|
| | |
|
| |
|
|
|
| |
* used queue instead of ordinary list
* use deque instead of queue
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add minimal mypy configuration file.
* Add mypy workflow to GH.
* Properly import sentinels from traversal.edgedfs.
* mypy doesn't like variables named \"e\".
* Rm annotations from single function.
* Fix name collisions in test suite.
Make sure all tests have unique names.
* Rm unused random seed in test setup.
* Rm redundant __all__ specification.
* Silence mypy error from sum(). Mypy bug?
* Fix tsp test instantiation nit.
* \"type: ignore\" to suppress conditional fn sigature errors.
* Remaining \"type: ignore\" to appease mypy.
* Configure mypy to ignore inheritance issues.
* Update exclude conf for CI.
- Add yaml
- Reformat regex containing reportviews
* Rm partial annotations from lukes.py.
Fixes mypy errors due to unannotated code.
* Reorg defaultdict to reduce type: ignore cruft.
* Homogenize signatures for fns defined in conditionals.
* err as varname only in exception catching.
* Fix name collision in Bellman-Ford test suite.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Drop Py37
* XML serialization issue
* Use math.comb
Co-authored-by: Simone Gasperini <simone.gasperini2@studio.unibo.it>
* Run pyupgrade --py38-plus
* Run black
* More documentation
* Deprecate euclidean
Co-authored-by: Simone Gasperini <simone.gasperini2@studio.unibo.it>
|
| |
|
|
| |
A more descriptive variable name for exceptions. This reduces local var naming conflicts when
\`e\` is used e.g. to represent edges as a loop variable.
|
| |
|
| |
In return value description: "vale" -> "value"
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Betweenness: Use lowest weight of parallel edges
* Betweenness: Add edge keys for edge betweenness centrality
* betweenness: Test multigraph edge betweenness centrality
* betweenness: Add missing test docstrings
* betweenness: Test distinct weighted shortest paths
* betweenness: Create dict with edge keys for multigraphs
* betweenness: Fix reference in docstring for weight
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Fix links, use DOI links, wayback machine where required
* Add nx-guides to intersphinx mapping.
* Replace external mpl link w/ intersphinx.
* Update mpl intersphinx mapping.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |
|
| |
and deprecate adj_matrix
|
| |
|
|
|
|
|
|
|
| |
communicability_betweenness_centrality (#4843)
* Remove unued `normalized` parameter from communicability_betweenness_centrality
* dd API change to release_dev.rst
* add tests for small graphs
|
| |
|
|
|
| |
* Use pytest.approx
* Deprecate almost_equal
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix random.sample warnings in maxcut tests.
* Fix random.sample warnings in betweenness.
* Add sorted to sampling in triads + tests.
* Add sorted to random_uniform_k_out_graph gen.
* add sorted to random.sample in internet_as_graphs.
* No sorted on nodes of graphs in general.
* No sorted in random_uniform graph generator.
|
| |
|
| |
Co-authored-by: Ludovic Stephan <ludovic.stephan@ens.fr>
|
| |
|
|
|
| |
Fixes #3921
* weight description
|