summaryrefslogtreecommitdiff
path: root/networkx/algorithms/euler.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix defect in eulerize, replace reciprocal edge weights (#6145)Radoslav Fulek2022-11-081-3/+14
| | | | | | 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>
* Add function bfs_layers to docs (#5932)Dan Schult2022-08-171-2/+2
| | | Add function bfs_layers to docs. fix two doc formatting typos
* 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)
* Disallow isolated nodes for Eulerian Path (#5616)Dilara Tekinoglu2022-05-121-13/+43
| | | | | | | | | | | | | | | | | | | | | | | * 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>
* Drop Py37 (#5143)Jarrod Millman2021-10-231-1/+1
| | | | | | | | | | | | | | | | | | | * 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>
* DOC: Switch from napoleon to numpydoc sphinx extension (#4447)Ross Barnowski2020-12-121-1/+1
| | | | | | | * Setup for numpydoc. * Add to doc requirements. * Replace napoleon with numpydoc in conf.py. * DOC: Fixups from numpydoc.
* Update tests and docs for has_eulerian_path (#4344)cpurmessur2020-11-131-3/+13
| | | | | | * Parametrize tests on graph type * Update docstring description of source parameter. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Eulerian path fix (#4317)cpurmessur2020-11-121-13/+41
| | | | | | | | | | | * Possible solution for euler path * Added source to has_eulerian, fixed eulerian path, added test for eulerian path * Fixed undirected issue * Added additional test cases to eulerian_path * Added additional test cases to has_eulerian_path
* Fix bug in has_eulerian_path for directed graphs (#4246)cpurmessur2020-10-151-7/+19
| | | Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Format w/ blackJarrod Millman2020-07-101-17/+24
|
* Upgrade to Py36 syntaxJarrod Millman2020-01-011-4/+2
| | | | find networkx -name \*.py -exec pyupgrade --py36-plus {} \;
* Remove superfluous encoding informationJarrod Millman2019-11-111-1/+0
|
* Remove boiler plate from top of modulesJarrod Millman2019-11-111-12/+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.
* Implemented Euler Path functions (#3399)Jacob2019-10-011-6/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added Euler Path functions. Added functions to test for and find an Euler path in a graph. Previous functions only accommodate Euler circuits/cycles (an Euler path that starts and ends on the same node). * Added tests for Euler Path functions. Added initial test classes and tests for new Euler Path related functions added to euler.py * Added missing local imports. Added missing local imports for new tests. * Update euler.py * Changed _find_path_start to find_path_start Changed 'hidden' function to 'public' for importability in tests. * Changed references to _find_path_start Changed references to _find_path_start to find_path_start (as per in main file euler.py). * Corrected errors in test cases. Corrected errors in test cases. Typo equals instead of equal, and 'Digraph' instead of nx.diGraph. * Fixed misplaced bracket. * Fixed test example. * Fix missing bracket. * Added warning about source argument values. * Fix up docs for eulerian path function. pycodestyle, etc * change tests to use name _find_path_start * remove unicode minus sign in doc_strings latex having trouble with * Update docs for euler and index
* [WIP] Added function to eulerize simple graphs to algorithms.euler (#3076)mtrenfield2018-07-231-3/+78
| | | | | | | | | | | | | | | | | | | * Added function to eulerize simple graphs to algorithms.euler * modified comments in algorithms.euler.eulerize * Modified tests for eulerize to handle empty graph, multigraphs, and ensure that the returned graph is isomporphic to the input graph when the input graph is Eulerian * modified eulerize function to make use of nx.utils.pairwise * fixed typos in test_euler.py and modified style to be PEP8-compliant * modified euler.py for PEP8 compliance * fixed typo in test_euler.py * Modified eulerize to raise an NetworkXPointlessConcept exception on the null graph Fixes #2869
* Fix links (#2663)Jarrod Millman2017-09-111-1/+1
| | | | | | * Fix links * Comply with pep8
* Comply with pep8Jarrod Millman2017-08-171-2/+2
|
* Next attempt to meld graphviews with base classes (#2593)Dan Schult2017-08-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | * Update code to prepare for melding graphviews * Meld graphviews into graph classes * Cleanup subgraph calling sign. and remove duplicate code * Add some tests for raising exceptions * update edge_kcomponents to avoid readonly views. * Add root_graph attribute and tests Update tests for root_graph as well as fresh_copy. I left fresh_copy as an attribute even with root_graph because a view might switch the data structure of the view from directed to undirected. Going to the root_graph.__class__ may not give you what you need to create a graph like the view. Fresh_copy gives a null graph with the directed/multi type of that view or graph.
* Add graph view classes for nodes/edge/degrees (#2458)Dan Schult2017-06-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Dont assume iterators for nodes/edges/degrees (prep for views) * Add graph view classes for nodes/edges/degree * Add right set operations (not present in python3.3 KeysView * Add nodes before adding edges so python36 tests work By only adding edges, the nodes were added in order (0,1,3,2) and with the ordered nature of python3.6 dicts the tests failed. Could also fix by using nodelist on each call to to_convert_... * weighted graph convert tests testing empty graphs The edge iterator was exhausted for source before being used for dest * allow DegreeView to include case of nbunch * Make node/edge/degree properties of Graph * View contains fix and Viewers can return self. More tests * Add more tests including one for #2347 * Add nbunch tests and pep8 * Rename to EdgeView and EdgeDataView * docs tweaks and pep8 * fix up nodeDataView contains. Add and clean up tests. * Tweaks to improve speed for nodes and edges. * improve views dependence on ABCs, remove len from dataviews * First pass on docs in views.py * Change property to lazy attribute
* minor corrections to doc comments (#2453)Jamie Cox2017-05-151-1/+1
|
* Adds multigraph keys to Eulerian circuitsJeffrey Finkelstein2017-02-051-34/+67
|
* Change default role for sphinx to 'obj'Dan Schult2016-03-031-3/+3
| | | | | | | | Change double `` to single ` for all function arguments. Remove double `` around True, False, None Leave double `` when a literal python expression is intended. I found a couple of places where math mode was intended. Still need to look for those.
* Merge master into iter_refactorDan Schult2015-08-071-51/+58
|
* Remove degree_iter(),now degree() returns an integer for single node and ↵Mridul Seth2015-06-271-1/+1
| | | | iterator for else
* Remove edges_iter, G.edges() now returns an iterator instead of listMridul Seth2015-06-171-2/+2
|
* Makes Graph.nodes() return iterator instead of listJeffrey Finkelstein2015-06-111-2/+2
| | | | | | | Previously `Graph.nodes()` returned a list of nodes and `Graph.nodes_iter()` returned an iterator over nodes. With this commit, the former function now returns an iterator and the latter no longer exists.
* Merge digraph and graph algorithmAric Hagberg2013-12-151-34/+28
| | | | Use unified graph and digraph algorithm. It's arguable whether this is easier to read but it is less code anyway.
* added referenceswatmad2013-12-131-1/+8
|
* compatibility with python3Stepan Artamonov2013-12-131-2/+2
|
* documentation updatedswatmad2013-12-131-12/+6
|
* fast euler cycle algorithm implementedswatmad2013-12-131-15/+27
|
* Clean up documentation and commentsAric Hagberg2010-09-121-19/+29
|
* Fix wrong license text.Aric Hagberg2010-09-121-4/+4
|
* Update some doctests. Addresses #385aric2010-08-071-6/+6
| | | | | --HG-- extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401864
* Merging py3k-1.2 branch into trunk. Addresses #348loicseguin2010-08-021-1/+1
| | | | | --HG-- extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401832
* Add eulerian graph and circuit functions.aric2010-07-221-0/+125
Fixes #363 --HG-- extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%401774