<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/networkx.git/doc/reference/algorithms/tree.rst, branch main</title>
<subtitle>github.com: networkx/networkx.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/networkx.git/'/>
<entry>
<title>Add random_spanning_tree to documentation (#5810)</title>
<updated>2022-06-23T15:47:20+00:00</updated>
<author>
<name>Matt Schwennesen</name>
<email>mjschwenne@gmail.com</email>
</author>
<published>2022-06-23T15:47:20+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/networkx.git/commit/?id=fb78a50a95e74b444c55dcece2772f04ddc719a3'/>
<id>fb78a50a95e74b444c55dcece2772f04ddc719a3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>GSoC Asadpour ATSP Implementation Pull Request (#4740)</title>
<updated>2021-08-23T12:50:12+00:00</updated>
<author>
<name>Matt Schwennesen</name>
<email>mjschwenne@gmail.com</email>
</author>
<published>2021-08-23T12:50:12+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/networkx.git/commit/?id=e098dccd8be4e08497117fa39d66800907c2a932'/>
<id>e098dccd8be4e08497117fa39d66800907c2a932</id>
<content type='text'>
* 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

* Stub for Asadpour. Needed to create GSoC PR

* Update to integrate changes from main

* Added function stubs and draft docstrings for the Asadpour algorithm

* testing

* I'm not entirly sure how the commit hook works...

* Moved iterators into the correct files to maintain proper codebase visibility

* Including Black reformat

* Grabbing black reformats

* Working on debugging ascent method plus black reformats

* Ascent method terminating, but at non-optimal solution

* minor edits

* Fixed termination condition, still given non-optimal result

* Minor bugfix, still non-optimal result

* Fixed subtle bug in find_epsilon()

* Cleaned code and tried something which didn't work

* Modified the ArborescenceIterator to accept init partition

* Black formats

* Branch and bound returning optimal solution

* Working Ascent method, code needs cleaning

* black formatting changes

* Performance tweaks and testing fractional answers

* Fixed test bug, I hope

* Asadpour output for ascent method

* Fixed numpy imports crashing pypi tests

* Removed branch and bound method. One unit test misbehaving

* Added asymmetric fractional test for the ascent method

* Removed printn statements and tweaked final test to be more asymmetric

* Draft of spanning_tree_distribution

* Black changes

* Changed HK to only report on the support of the answer

* Fixed contraction bug by changing to MultiGraph. Problem with prob &gt; 1

* Black reformats

* Fixed pypi test error

* Further testing of dist fix

* Can sample spanning trees

* Developing test for sampling spanning tree

* Changed sample_spanning_tree test to Chi squared test

* Tweaked signifiance level

* Found true minimum sample size

* fixed typo

* untested implementation of asadpour_tsp

* Fixed issue reading flow_dict

* Fixed runtime errors in asadpour_tsp

* black reformats

* Adding test cases

* documentation update

* Fixed rounding error with tests

* One new test and check

* Documentation update for the iterators

* Attempting to fix class documentation

* Reventing documentation changes

* Update mst.py to accept suggestion

Co-authored-by: Dan Schult &lt;dschult@colgate.edu&gt;

* Update branchings.py accept doc string edit

Co-authored-by: Dan Schult &lt;dschult@colgate.edu&gt;

* Review suggestions from dshult

* Cleaned code, merged functions if possible and opened partition functionality to all

* Fixed pypi test error

* Implemented review suggestions from rossbar

* review edits

added SpanningTreeIterator to algorithms/__init__.py

* Update __init__.py

ack, hasty / stupid change was meant to be a draft; github isn't letting me make a new branch to PR into this one

* fixed misspelling of Kirchhoff

* Implement suggestions from boothby

Co-authored-by: Thodoris Sotiropoulos &lt;theosotr@windowslive.com&gt;
Co-authored-by: Luca Cappelletti &lt;cappelletti.luca94@gmail.com&gt;
Co-authored-by: Dan Schult &lt;dschult@colgate.edu&gt;
Co-authored-by: Ross Barnowski &lt;rossbar@berkeley.edu&gt;
Co-authored-by: Kelly Boothby &lt;kelly.r.boothby@gmail.com&gt;
Co-authored-by: Kelly Boothby &lt;boothby@dwavesys.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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

* Stub for Asadpour. Needed to create GSoC PR

* Update to integrate changes from main

* Added function stubs and draft docstrings for the Asadpour algorithm

* testing

* I'm not entirly sure how the commit hook works...

* Moved iterators into the correct files to maintain proper codebase visibility

* Including Black reformat

* Grabbing black reformats

* Working on debugging ascent method plus black reformats

* Ascent method terminating, but at non-optimal solution

* minor edits

* Fixed termination condition, still given non-optimal result

* Minor bugfix, still non-optimal result

* Fixed subtle bug in find_epsilon()

* Cleaned code and tried something which didn't work

* Modified the ArborescenceIterator to accept init partition

* Black formats

* Branch and bound returning optimal solution

* Working Ascent method, code needs cleaning

* black formatting changes

* Performance tweaks and testing fractional answers

* Fixed test bug, I hope

* Asadpour output for ascent method

* Fixed numpy imports crashing pypi tests

* Removed branch and bound method. One unit test misbehaving

* Added asymmetric fractional test for the ascent method

* Removed printn statements and tweaked final test to be more asymmetric

* Draft of spanning_tree_distribution

* Black changes

* Changed HK to only report on the support of the answer

* Fixed contraction bug by changing to MultiGraph. Problem with prob &gt; 1

* Black reformats

* Fixed pypi test error

* Further testing of dist fix

* Can sample spanning trees

* Developing test for sampling spanning tree

* Changed sample_spanning_tree test to Chi squared test

* Tweaked signifiance level

* Found true minimum sample size

* fixed typo

* untested implementation of asadpour_tsp

* Fixed issue reading flow_dict

* Fixed runtime errors in asadpour_tsp

* black reformats

* Adding test cases

* documentation update

* Fixed rounding error with tests

* One new test and check

* Documentation update for the iterators

* Attempting to fix class documentation

* Reventing documentation changes

* Update mst.py to accept suggestion

Co-authored-by: Dan Schult &lt;dschult@colgate.edu&gt;

* Update branchings.py accept doc string edit

Co-authored-by: Dan Schult &lt;dschult@colgate.edu&gt;

* Review suggestions from dshult

* Cleaned code, merged functions if possible and opened partition functionality to all

* Fixed pypi test error

* Implemented review suggestions from rossbar

* review edits

added SpanningTreeIterator to algorithms/__init__.py

* Update __init__.py

ack, hasty / stupid change was meant to be a draft; github isn't letting me make a new branch to PR into this one

* fixed misspelling of Kirchhoff

* Implement suggestions from boothby

Co-authored-by: Thodoris Sotiropoulos &lt;theosotr@windowslive.com&gt;
Co-authored-by: Luca Cappelletti &lt;cappelletti.luca94@gmail.com&gt;
Co-authored-by: Dan Schult &lt;dschult@colgate.edu&gt;
Co-authored-by: Ross Barnowski &lt;rossbar@berkeley.edu&gt;
Co-authored-by: Kelly Boothby &lt;kelly.r.boothby@gmail.com&gt;
Co-authored-by: Kelly Boothby &lt;boothby@dwavesys.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>junction_tree for #1012 (#4004)</title>
<updated>2020-08-16T00:32:27+00:00</updated>
<author>
<name>Matthias Bruhns</name>
<email>45033731+mbruhns@users.noreply.github.com</email>
</author>
<published>2020-08-16T00:32:27+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/networkx.git/commit/?id=9813a65391d5852188321a73bb09f2e38aa1cfd3'/>
<id>9813a65391d5852188321a73bb09f2e38aa1cfd3</id>
<content type='text'>
* Initial commit.

* Fixed PEP 8 issues.

* Fixed more PEP 8 issues.

* Added type to sepset-nodes.

* Moved file to networkx/algorithms/tree, changed name of module to avoid namespace collision, added entry to doc system, changed deepcopy to list, removed check for None, shifted to G.is_directed(), added example.

* Removed example code.

* Removed unused import statement.

* Moved notes section.

* Fixed PEP 8 issues and removed old file.

* Fixed PEP 8 issues.

* Formatting with Black, added docstring to example and removed license information.

* Added name to name of contributors.

* Ran black

i.e.,
black networkx/algorithms/tree/tests/test_junction_tree_algorithm.py

* Updated explanation of junction trees, removed 'Graph' from unsupported classes.

* DOC: tweaks to docstring.

* Changed naming and updated docstring/code according to suggestions.

* Removed old files.

* Updated doc and init.

* Minor tweaks in docs and import structure

* Improve example

Co-authored-by: Jarrod Millman &lt;jarrod.millman@gmail.com&gt;
Co-authored-by: Ross Barnowski &lt;rossbar@berkeley.edu&gt;
Co-authored-by: Dan Schult &lt;dschult@colgate.edu&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Initial commit.

* Fixed PEP 8 issues.

* Fixed more PEP 8 issues.

* Added type to sepset-nodes.

* Moved file to networkx/algorithms/tree, changed name of module to avoid namespace collision, added entry to doc system, changed deepcopy to list, removed check for None, shifted to G.is_directed(), added example.

* Removed example code.

* Removed unused import statement.

* Moved notes section.

* Fixed PEP 8 issues and removed old file.

* Fixed PEP 8 issues.

* Formatting with Black, added docstring to example and removed license information.

* Added name to name of contributors.

* Ran black

i.e.,
black networkx/algorithms/tree/tests/test_junction_tree_algorithm.py

* Updated explanation of junction trees, removed 'Graph' from unsupported classes.

* DOC: tweaks to docstring.

* Changed naming and updated docstring/code according to suggestions.

* Removed old files.

* Updated doc and init.

* Minor tweaks in docs and import structure

* Improve example

Co-authored-by: Jarrod Millman &lt;jarrod.millman@gmail.com&gt;
Co-authored-by: Ross Barnowski &lt;rossbar@berkeley.edu&gt;
Co-authored-by: Dan Schult &lt;dschult@colgate.edu&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Revise docs (#2524)</title>
<updated>2017-07-19T04:25:09+00:00</updated>
<author>
<name>Jarrod Millman</name>
<email>jarrod.millman@gmail.com</email>
</author>
<published>2017-07-19T04:25:09+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/networkx.git/commit/?id=121335053f10f8a7af648bacb36d6300fc1953f6'/>
<id>121335053f10f8a7af648bacb36d6300fc1953f6</id>
<content type='text'>
* Finish directory reorg and make minor text edits

* Remove cruft from conf.py

* Fix broken links and comply with pep8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Finish directory reorg and make minor text edits

* Remove cruft from conf.py

* Fix broken links and comply with pep8
</pre>
</div>
</content>
</entry>
</feed>
