sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.48k stars 488 forks source link

faster matroid 3 connectivity #18539

Closed b4a46f46-8d8a-415c-ad35-64549def2993 closed 9 years ago

b4a46f46-8d8a-415c-ad35-64549def2993 commented 9 years ago

Implement the efficient 3 connectivity algorithm.

R. E. Bixby, W. H. Cunningham, Matroids, Graphs, and 3-Connectivity. In Graph theory and related topics (Proc. Conf., Univ. Waterloo, Waterloo, ON, 1977), 91-103

Depends on #18448

CC: @sagetrac-Stefan @sagetrac-yomcat @sagetrac-Rudi

Component: matroid theory

Author: Chao Xu

Branch/Commit: 482ce85

Reviewer: Michael Welsh, Rudi Pendavingh

Issue created by migration from https://trac.sagemath.org/ticket/18539

b4a46f46-8d8a-415c-ad35-64549def2993 commented 9 years ago
comment:40

Good point. updated.

35e1b81c-f27a-4274-bfe3-67d727b6c772 commented 9 years ago

Reviewer: Michael Welsh

35e1b81c-f27a-4274-bfe3-67d727b6c772 commented 9 years ago
comment:41

I'm happy with it now. I'll wait for Stefan/Rudi to give the final sign off. And patchbot should get involved.

156bf7a1-cdbf-4d2b-a578-797e3af0730c commented 9 years ago
comment:42

Hi Chao,

I think the code as such looks great and works great. Repair these last few issues and I'll give a positive review:

The docstring of is_3connected only mentions BC under ..ALGORITHM:. Please also describe the other method.

When _is_3connected_BC throws NotImplementedError, give a description of the problem , e.g. NotImplementedError("The Bixby-Cunningham algorithm does not return a separation")

In the docstring of _is_3connected_CE and _is_3connected_BC, there are several X and one T that need to have single accolades (now double). You can check the appearance of the docstring in the notebook by entering M._is_3connected_BC? on a matroid M.

Finally, I don't believe keeping&depricating the option separation is necessary in this case. This option was introduced in 6.8 beta and so never saw an official release. So if we make sure it's gone before 6.8 is released we should be fine.

If the others agree you can perhaps still change this. Otherwise I'll give the positive review after you settled the above 3 issues.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

183b216updated docs
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 6a3484d to 183b216

156bf7a1-cdbf-4d2b-a578-797e3af0730c commented 9 years ago
comment:44
Error building the documentation.
Traceback (most recent call last):
  File "/Users/rudi/Documents/Development/sage-6.7/src/doc/common/builder.py", line 1626, in <module>
    getattr(get_builder(name), type)()
  File "/Users/rudi/Documents/Development/sage-6.7/src/doc/common/builder.py", line 292, in _wrapper
    getattr(get_builder(document), 'inventory')(*args, **kwds)
  File "/Users/rudi/Documents/Development/sage-6.7/src/doc/common/builder.py", line 503, in _wrapper
    x.get(99999)
  File "/Users/rudi/Documents/Development/sage-6.7/local/lib/python/multiprocessing/pool.py", line 558, in get
    raise self._value
OSError: [matroids ] docstring of sage.matroids.matroid.Matroid.is_3connected:33: WARNING: Bullet list ends without a blank line; unexpected unindent.
156bf7a1-cdbf-4d2b-a578-797e3af0730c commented 9 years ago

Changed reviewer from Michael Welsh to Michael Welsh, Rudi Pendavingh

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 183b216 to 2372476

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

2372476indent problem
156bf7a1-cdbf-4d2b-a578-797e3af0730c commented 9 years ago
comment:46

Code compiles, tests succeed, docs build.

Positive review!

vbraun commented 9 years ago
comment:47

merge conflict, probably #18448

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 2372476 to 34be00b

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

34be00bMerge branch 'develop' into t/18539/faster_matroid_3_connectivity
b4a46f46-8d8a-415c-ad35-64549def2993 commented 9 years ago
comment:50

What can I do at this point to resolve the merge conflict?

156bf7a1-cdbf-4d2b-a578-797e3af0730c commented 9 years ago
comment:51

Hi Chao,

I am also still learning git so perhaps I'm not the right person to give expert advice. But take a look at the way a merge conflict is resolved in this recent ticket #17492. The way to go seems to be to merge the conflicting ticket #18448 into your code. You can do so by a git trac pull 18448 while working on your ticket (this is destructive so if you want to be safe, perform a merge of the two patches in a separate branch). The automatic merge will partially fail and you have to repair some of the source (probably matroid.pyx). Places where the automerger could not decide what to do will be indicated in the source with <<< and >>>.

I doubt that the manual merge will be very difficult in this case, the issue is probably that the new code in both tickets are more or less in the same location. If you want, I will attempt the merge for you.

Just merging develop into your branch as you just did may not suffice, since 18448 is not yet part of develop.

Cheers, Rudi

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

edaf4c7Improved docstrings, added .is_binary() for BinaryMatroid and RegularMatroid
7ad1f5bDocstring improvements
503b1e7Finishing touch docstrings
63767a1One more ALGORITHM block
8967234Fixed latex in docstring
29e84daMerge branch 'u/Rudi/add_test_if_a_matroid_is_binary' of trac.sagemath.org:sage into u/Rudi/add_test_if_a_matroid_is_binary
ada6742Some changes, tweaks, and made a method public.
b9c3268Added method .binary_matroid() for Matroid, BinaryMatroid, RegularMatroid
fab68ccdeleted a white space that messed up unindent in docs
482ce85Merge branch 'u/Rudi/binary_matroid-18448' of git://git.sagemath.org/sage into t/18539/faster_matroid_3_connectivity
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 34be00b to 482ce85

b4a46f46-8d8a-415c-ad35-64549def2993 commented 9 years ago
comment:53

Thanks Rudi, I followed your steps. Hopefully this solves all the conflicts.

156bf7a1-cdbf-4d2b-a578-797e3af0730c commented 9 years ago
comment:54

Yes, that should do it. Positive review again.

156bf7a1-cdbf-4d2b-a578-797e3af0730c commented 9 years ago

Dependencies: 18448

vbraun commented 9 years ago

Changed branch from u/chaoxu/faster_matroid_3_connectivity to 482ce85