summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Fix inverse_line_graph. (#3507)"revert-3507-masterDan Schult2019-08-072-46/+8
| | | | This reverts commit a505a5fe000983ff8c0861a1806b31c9ac638946.
* Fix inverse_line_graph. (#3507)Martin Darmüntzel2019-08-072-8/+46
| | | | | | | | | | | | * Fix inverse_line_graph. * Replaces all calls to neighbors() in the line graphs module. * Adds explanatory note for inverse_line_graph on multiple components. * Expands and fixes doctests of `inverse_line_graph` * Small fix of doctest of `inverse_line_graph`
* Linear prufer coding (#3535)Jacob Jona Fahlenkamp2019-08-061-6/+6
| | | | | | * unnecessary scanning of entire range * wrong run time in documentation
* Restore checking PyPy3 (#3514)Omer Katz2019-08-0210-26/+36
| | | | | | | | | | | | * Resotre checking PyPy3. I don't know why it was removed but PyPy3 now supports Python 3.5 and hopefully the next major PyPy version will support PyPy 3.6. * Fix pypy name. * Reduce test dependency on items order. * Change planar_drawing test and allow edge order flips in tests
* Small fix for bug found @ issue #3524 (#3529)Alexios Polyzos2019-07-281-1/+1
| | | | Fixes #3524 Divide by zero replaced with zero simrank value
* Optimize the strongly connected components algorithm - Take 2 (#3519)Omer Katz2019-07-251-7/+2
| | | | | | * Remove the unnecessary usage of the nbrs dictionary. * Update scc_found just once.
* Added safeguards (input graph G) for non-randomness measures (#3526)Erwan Le Merrer2019-07-252-0/+10
| | | | | | * Added safeguards for input graph G * Name added to contributors
* Adding non-randomness measures for graphs (#3515)Erwan Le Merrer2019-07-205-0/+121
| | | | | | | | | | | | | | | | | | | | * Adding non-randomness measures for graphs * Adding doc files * Bux fix in .rst content * Travis bugs fixing attempt * Travis bug: numpy import problem * Travis bug: numpy import problem in test_non_randomness * following Dan s comments * following Dan s comments #2 * following Dan s comments #3
* Optimize the strongly connected components algorithm. (#3516)Omer Katz2019-07-191-6/+6
| | | | | | Replaced the scc_found dictionary with a set since we don't use the value of the dictionary. Changed done's variable type to boolean so that PyPy's JIT would recognize that there are only two possible states for the condition.
* Full join operation and cograph generator (#3503)Efraim Rodrigues2019-07-188-1/+293
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * * Implements full join operation and a generator for cographs. * * Adding myself as a contributor. * * Fix full join description. * * Removes full_join function from the cograph generator file. * * Changes ^ for **. * Docstrings improvements, fixes and new tests. * Includes new features in the docs. * Fix typo in test_cograph.py. * Random cograph docstring improvements. * Adds support for directed graphs. * Improvements to the full join operator and new tests. * Fixed rename. * Fix test description.
* Update introduction.rst (#3504)Kevin Newman2019-07-101-1/+1
| | | Example uses nodecolor='r', should be node_color='r'
* AT-free graph recognition (#3377)Haakon2019-06-305-0/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Included asteroidal module. * Initial commit for asteroidal module. The asteroidal module implements a function which checks whether a given graph is AT-free or not. * Tests for asteroidal.py The tests include checks for small, well-known cases of AT-free and non-AT-free graphs. * Updated runtime for recognition algorithm in docstring. * Included "r" to start docstring to enable LaTeX codes. * Included .rst file for asteroidal module * Fixed not implemented for decorator statements If multiple types are inputed into a decorator this works as an AND condition, but we want an OR condition. * Refactoring of unnecessary work The helper function in is_at_free now consists of a return statement directly, which saves having to evaluate boolean statements unneccesarily. The for loop in the component_strucutre function now omits an unecessary generator definition. * Updated docstring to reflect optional output and runtime. The docstring now includes a more precise description of the worst-case runtime. The optional output parameter `certificate` is more thoroughly documented. * Change optional output to a tuple including a bool * Refactor tests to be shorter and more readable * Included tests with certificate option enabled. The certificate option outputs a certificate, if any exists, which proves that a graph is not AT-free. * Fix bug due to typo in tests An 's' had snuck its way into an assert_equal statement, and I didn't check properly before pushing. * docstring for is_at_free re-structured and re-formulated. * Split is_at_free method The previous method had an extra parameter, `certificate`, that could be used to decide whether the output should be a boolean value or a tuple with a boolean value and a certificate. This has now been split into two functions: `is_at_free` and `find_asteroidal_triple`, for more intuitive behaviour. * Changed `is_at_free` to find_asteroidal_triple The new version returns an asteroidal triple if one exists and returns None if none exists. This method is used in the new `is_at_free` method. * Updated docstrings Docstrings updated to reflect changed functionality and new structure. * Refactor `find_asteroidal_triple` The previous version defined a function to check whether a triple of vertices is an asteroidal triple. The current version uses this function inline instead, to avoid many function calls in order to increase performance. * Refactored return statement in `is_at_free` Removed the else block according to Chromium style guide. * feat: expose `find_asteroidal_triple` The find_asteroidal_triple is also imported when the asteroidal module is imported. * style: refactor is_at_free The function can be written as a readable oneliner instead of using an if else block. * docs: asteroidal: updated module docstring Rewrote module docstring to be more precise. * chore: include find_asteroidal_triple in reference The find_asteroidal_triple is now exposed when importing the asteroidal module so the method should also be included in the asteroidal.rst for auto-generation of documentation. * Added myself, Haakon H. Rød, as a contributor * chore: removed redundant tests Some tests are no longer valid after changing the output of `is_at_free` to purely boolean.
* Fixes Issue #3493 - Bug in lexicographical_topological_sort() (#3494)Subhendu Ranajn Mishra2019-06-292-14/+46
| | | | | | | | | | | | | * Add 'NodeId' to the tuple to handle the cases where keys are same for two or more nodes * Add tests for issue #3493 * consider 'nodeid' while unpacking the tuple from list * minor changes for PEP8/pycodestyle * allow arbitrary order of list(G) for py3.5 tests Fixes #3493
* Fixed incorrect docs (#3495)Nanda H Krishna2019-06-292-14/+9
| | | Fixes #3483 which was already partially fixed by #3484
* Added group closeness and group degree centralities (#3437)Nanda H Krishna2019-06-283-8/+365
| | | | | | | | | | | | | | | | | | | | | | * Added group closeness centrality * Fixed tests * Added group degree centrality * Math fixes for docs * Minor fixes in math * Doc indentation, exceptions and tests * Edited test decription * Remove explicit raise, modify neighbors() raise * Exception changes * Revert change, use NetworkXError
* Fix dfs_preorder_nodes docstring saying "edges" instead of "nodes" (#3484)Tamás Bitai2019-06-251-1/+1
|
* Fix deprecation warning with Python 3.7 (#3487)Alexander Metz2019-06-231-2/+2
| | | | Replace collections.Iterable with collections.abc.Iterable to fix deprecation warning with Python 3.7: "DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working"
* Wheels are python 3 onlyPeter2019-06-221-3/+0
| | | | | version 2.3 dropped python2 support until py2 is actually deprecated we shouldn't mark these wheels as universal
* No multigraphs for betweenness (#3454)Nanda H Krishna2019-06-191-0/+2
| | | Fixes #3432
* New Feature - Resistance Distance (#3385)bkief2019-06-145-10/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * First pass of resistance distance logic * Made inverting the weight optional. Removed zero_approx parameter Added name to contributors * csr/csc slice and tranformation more effecient and simple for single row/col deletion * * Split permulation count into seperate funciton * added tests * Faster submatrix approach * Made tests more readable * Added whitespace * Clean up styling, pep8 * Fixed nx test class import * Simplied test imports * Fixed prior merge error * Fixed prior merge issue in docstring * Couple of final pep8 changes * Added testing for non-scipy builds * minor tweaks of if logic and comments
* Adding onion decomposition (#3461)Antoine Allard2019-06-123-3/+120
| | | | | | | | | | | | | | * added the new function onion_layers to core.py * added details to the documentation ofthe new function onion_layers to core.py * added the test function test_onion_layers in file test_core.py * Minor changes to onion_layers() * Minor changes to onion_layers() and to core.rst * Small adjustment to core.py
* Naive k-truss algorithm implementation. (#3462)Martin James McHugh III2019-06-123-1/+81
| | | | | | | | | * Added algorithm for calculating maximal k-truss to core.py. Added unit tests to test_core.py. * Added decorators to enforce graph simplicity. Added function to documentation generation file. * Updated implementation for improved performance.
* Fix typo in "G>raph Modelling Language" (#3468)Peter Cock2019-06-081-1/+1
|
* don't remove ticks of other pyplot axes (#3476)Elan Ernest2019-06-081-4/+4
| | | fixes #3475
* Replace cb.iterable with np.iterable (#3458)James Myatt2019-06-061-6/+4
| | | | | | `matplotlib.cbook.iterable` is deprecated in matplotlib 3.1 https://matplotlib.org/3.1.0/api/cbook_api.html#matplotlib.cbook.iterable Fixes #3466
* Set seed in random_degree_sequence_graph docstring test (#3451)Nanda H Krishna2019-05-231-1/+1
| | | fixes #3451
* Implemented subgraph monomorphism (#3435)Diogo Cruz2019-05-232-188/+308
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implemented subgraph monomorphism * Add checks for monomorphism * Corrected error in test file * Retrying checks * Added tests for multigraphs * Fixed error * Added more tests * More tests * Fixed errors * Fixed error * Error * Added explanation and rewrote mono argument * Fixed small error
* added topo_order parameter to functions that rely on topological_sort (#3447)Anthony Labarre2019-05-212-7/+28
| | | Fixes #3446
* Reorder and complete doc (#3438)Jean-Gabriel Young2019-05-131-11/+12
|
* Merge pull request #3436 from ↵Eric Ma2019-05-111-2/+2
|\ | | | | | | | | nandahkrishna/fix-typo-betweenness-centrality-subset-test Fixed typo in betweenness centrality subset test
| * Fixed typonandahkrishna2019-05-111-2/+2
|/
* Add two versions of Simrank similarity (#3222)Michael Recachinas2019-05-103-2/+291
| | | | | | | | | | | | | | | | | | | | | | * Adds function for computing SimRank value of nodes This function returns the SimRank values of each pair of nodes as a NumPy matrix. * Moves SimRank algorithm to new similarity module Also updates and simplifies the code. * Add similarity docs and tests * Fix docstring for simrank * Clean up docs - Fixes `C / len(nbrs_u) * len(nbrs_v)` to `C / (len(nbrs_u) * len(nbrs_v))` - Change "from zero to `n` where..." to "from 0 to `n-1` where" - Split the example on line 1124 to bring it within the 80 char PEP8 line limit Fixes #1691
* Fix centrality betweeness subset (#3425)michelb73982019-05-102-22/+68
| | | | | | | | * Update betweenness_subset.py * Update test_betweenness_centrality_subset.py * pep8-ify tests
* add required argument to `write_graphml` example (#3429)Almog Cohen2019-05-091-1/+1
|
* Fix UnionFind set extraction (#3224)Steffen Hirschmann2019-05-082-0/+15
| | | | | | | | | | | | | | | | | | | | | | | * Fix UnionFind set extraction Paths are not guaranteed to be fully pruned by the current implementation if subtrees are unioned, e.g.: > uf = UnionFind() > uf.union(1, 2) > uf.union(3, 4) > uf.union(4, 5) > uf.union(1, 5) In the current implementation, parents[1]=3 and parents[2]=1. Thus, the mere call of networkx.utils.groups(parents) will yield a wrong result: [set([2]), set([1, 3, 4, 5])] This patch fixes this behavior by simply doing a "find" operation (which, in turn, does full path pruning) on every key before calling groups. * Add test case for 35db1b5
* Add doc warning about self-loops for adamic_adar_index (#3427)Dan Schult2019-05-081-0/+2
| | | fixes: #3169
* Typo fix (#3424)Andy Garfield2019-05-071-1/+1
|
* Improve edgelist See Also (#3423)Ivan Tham2019-05-061-7/+10
| | | read_* should have more see also
* Adding module for group centrality measures (#3421)Nanda H Krishna2019-05-064-0/+184
| | | | | | | | | | | | | | | | | | | | | * Adding networkx.algorithms.centrality.group for group centrality measures * Minor changes and added tests * Fixed syntax error in testing, typo and copyright added * Fixed erroneous test case and error in normalization function * Updates based on review, fixed code style * Added more tests * Improvements and better test case * More efficient code * Edited test, file names for group Fixes #3388
* Fix edge_color inconsistency with node_color and description. (#3395)Jose Pinilla2019-05-032-103/+123
| | | | | | | | | | | | | | | | | | | | * Fix edge_color inconsistency with node_color and description. Issue #3394 * Alternatives to manage edge_color * Cycle through edge colors and widths if fewer than edges. Most color handling done by matplotlib. * Test arrows colors and widths. * Test both directed and undirected edge colors and widths * Alpha is None instead of 1.0 * Also test alpha given in hex * Add a couple more tests and update for PEP8 style Fixes #3394
* Binomial trees generator (#3409)Efraim Rodrigues2019-05-033-0/+34
| | | | | | | | * Implements the binomial tree graph generator. * Improvements to the binomial tree generator and Notes section. * Remove Notes section from the binomial_tree and moves the info to the line under the first line of the doc_string.
* Add bethe hessian matrix (#3401)Jean-Gabriel Young2019-05-036-1/+192
| | | | | | | | | | | | * Add bethe hessian matrix * travis-ci fixes * Better coverage * Add doc includes for Bethe Hessian matrix and spectrum in .rst * Tidy up author information / top of module of bethehessianmatrix
* Add barycenter algorithm (#2939)William Schwartz2019-05-024-39/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP add barycenter algorithm * attr parameter allows saving barycentricity value for each node * Fix error in test that didn't read updated calculation Should have included this in fdd22f1002 * Tests don't depend on NumPy, and improve docs * More doc clean up * Take advantage of new randomness API in NetworkX 2.2 * barycenter now returns nodes rather than subgraph This unifies barycenter's signature with center and periphery. See also https://github.com/networkx/networkx/pull/2939#issuecomment-407757160 * Cross reference docs for center, barycenter, and periphery * Clarify and simplify doc strings Also clarify name of a test utility function * Alphabetize imports * PEP8: Indent test module with spaces * Add sp keyword argument to barycenter This allows barycenter to use pre-computed shortest path lengths. * Make test more specific * Doc string style * PEP8: line lengths * Weights belong on the edges, not vertices The test is checking that you can't use the weight and sp arguments at the same time. For it to be even plausible that we're using the weight argument, the graph needs weights: *edge* weights. Not node weights as the previous version of the test had. * Move TestBarycenter from test_barycenter to test_distance_measures I don't know the nose package, so I was afraid of trying to develop the tests in the existing test_distance_measures module. However nose seems to play nicely with the standard unittest package, so we're all good. * Clean up tests in test_distance_measures.py
* Move LFR_benchmark to generators (#3411)Jean-Gabriel Young2019-05-028-522/+465
| | | | | | | | | * Move LFR_benchmark to generators * Correct import line in docstring * Removed LFR from algorithms.community.rst and put in generators.rst Fixes #3404
* Fix spring_layout bug with fixed nodes (#3415)Dan Schult2019-05-022-2/+16
| | | | | | | | | * Make spring_layout raise exception if fixed nodes specified and no pos-dict specified * Check that any fixed nodes have specified positions in input pos-dict Note: spring_layout is also fruchterman_reingold_layout. Before this, fixed nodes not in the pos-dict were assigned random positions.
* typo: swap source and target (#3413)Xiangyu Xu2019-04-302-3/+3
|
* Add the reference for the Harary graph generators (#3407)Weisheng Si2019-04-272-0/+12
| | | | | | | | | | * Update generators.rst Add the reference for the Harary graph generators. * Update CONTRIBUTORS.rst Add Weisheng Si as a contributor
* Add see also links (#3403)Jean-Gabriel Young2019-04-253-2/+5
|
* algorithms/traversal/edgebfs name fix (#3397)MCer42949672962019-04-202-2/+2
| | | | | | | | * edgebfs name fix This shows up in the documentation mistakenly * another edgebfs name fix
* Bump release versionJarrod Millman2019-04-111-2/+2
|