New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boost Edge Connectivity #18564
Comments
Author: Michele Borassi |
This comment has been minimized.
This comment has been minimized.
Changed keywords from none to Boost, connectivity |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
This version lets us use Boost graph library to compute edge connectivity. Probably it is not the cleanest way to do it, but at least it works. I am looking for suggestions on how to improve the code, in order to make it more readable:
Some benchmark:
Thank you very much! |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
Something is missing in
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
Now it should work! |
comment:9
Hellooooo Michele, Great work, thank you very much! If we can speedup several Sage functions the I have been trying to avoid the creation of these two .cpp/.hpp files, but no About your code:
Thank you very much for this improvement. That's no small speedup, and an Nathann PS: Set the ticket's status to 'needs_review' when you want somebody to look at it. [1] https://groups.google.com/d/topic/cython-users/ICRgCWVZ6RQ/discussion |
comment:10
Hello Michele, You will find at public/18564 a commit that avoids the creation of .hpp and .cpp files. Nathann |
comment:11
Hello Nathann, your branch is working well and this is easier than the first solution proposed by Michele.
I’m really impressed by what you did (both of you). |
comment:13
I have merged Nathann's work. I will continue from here! |
comment:15
Just a tip: if you run 'sage -cython -a your_file.pyx', you will get a .html file which indicates how much C code it takes to repleace each of your python lines (click on the yellow lines you see). With this, you can easily notice loops which involve Python though they should not. It is often because of variables of unspecified type. If you do the following replacement
you should see something happen in the loops involving Nathann |
comment:16
How can I tell it that the language is C++? |
comment:17
On my machine your code compiles. |
comment:18
The code also compiles on my computer |
comment:42
Hellooooooo! I summarize a discussion we had via email, dealing with the huge copy-paste. We found a way to avoid it: we created a C++ class boost_interface that interfaces Cython with Boost, and we used fused types to make generic functions accessing the C++ class. The drawback is that we cannot access Boost graphs from Python anymore: Boost graphs must be defined and deleted in the same cdef function. The advantage is that we can fully use the genericity of Boost, by calling any graph implementation we want. The new code is available in this ticket's branch, while the old code is still available at I changed the status to needs_work, because I would like to test the code and the doctest a bit more before asking for a review (in particular, I would like to check if all previous comments are still applied). |
comment:43
I like this new implementation. I assume it will be relativity easy to call other boost method the same way. |
comment:44
This comment needs to be expanded:
From reading the code, I have no idea what is Cython-unfriendly. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:46
Hello! I have opened a Boost ticket on edge connectivity (https://svn.boost.org/trac/boost/ticket/11406), I have added this link in the documentation of our edge connectivity, I have expanded the comment as asked by jdemeyer, and I have corrected some small issues. I hope that now the code is correct! |
comment:47
Hello, Install OK, tests OK, docbuild OK, page
For me the patch is good to go. However, it would be better if an expert in C++/boost/etc. could check the patch before setting it to positive review. Nice work anyway! David. |
Reviewer: Nathann Cohen |
comment:48
Helloooooo Michele, I made several modifications, available as a new commit at
Again, don't hesitate to oppose and discuss any of the changes in this commit, In my mind, the branch with this commit added is good to go, though perhaps the Have fun, and thank you very much again for this addition. Now that this is Nathann |
comment:50
Hello!
Also for me, now the patch is good to go! |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:52
Hello Michele,
Thanks! That's better.
Oh. Does that mean that there is "no bug" in boost because they never claimed that it worked? If so, several things need to be done:
Good. I missed that
OKayyyyyyyyyyy. Nathann |
comment:53
Well, not so fast! Martin told me that the edge connectivity is a work in progress, and that they might make it work on directed graph soon. Furthermore, I still think that the Boost code has a bug: the comment I mentioned is a line comment in the middle of the code, and a user does not necessarily read the whole code before using it! Furthermore, the comment does not say explicitly that they do not claim it works. For this reason, I have added a comment saying this in the Boost ticket, but I think we should leave the patch as it is, waiting for the final Boost edge connectivity! What do you think? Thank you very much, Michele |
comment:54
That I trust your advice on this matter. Good to go! (and thank you very much for this first 'boost' addition) Nathann |
Changed branch from u/borassi/boost_edge_connectivity to |
Changed commit from |
This is a first step in including Boost Graph Library (#17966). I would like to implement the edge connectivity algorithm by converting a given Sage graph into a Boost graph, apply the Boost edge connectivity algorithm, and convert the result.
CC: @nathanncohen @dcoudert @jdemeyer @jpflori @slel @SnarkBoojum @vbraun @williamstein
Component: graph theory
Keywords: Boost, connectivity
Author: Michele Borassi
Branch:
fe55f76
Reviewer: Nathann Cohen
Issue created by migration from https://trac.sagemath.org/ticket/18564
The text was updated successfully, but these errors were encountered: