-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Branch and Bound for vertex separation #17647
Comments
Branch: u/dcoudert/17647 |
Changed branch from u/dcoudert/17647 to public/17647 |
Commit: |
This comment has been minimized.
This comment has been minimized.
comment:5
A first question: you implement a graph data structure with bitsets... but what about using this instead? http://www.sagemath.org/doc/reference/graphs/sage/graphs/base/static_dense_graph.html Nathann |
comment:6
The |
comment:7
HMmmm... Agreed, but we can't keep on adding graph data structures in this graph_decomposition/ folder when we have a base/ directory where everything else is already. Let's not think about this now. I'll do a review first. |
comment:8
Actually, static dense graph is used only in |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:10
Hello David, Here are some superficial changes. It's faster to implement them than to write a long comment. Fix anything that you don't agree with. I am not done with the review, but I worry a bit about the fact that you allocate memory in a recursive function. They can cost a lot, these things. Do you see a clean way to avoid that ? Also, I did some profiling on your code and it seems that the most time-consuming operations is the call to popcount. I do not know where it is needed yet, but if you know how to work around that you would probably earn some perf. Tell me what you think, Nathann |
comment:11
Nice. I have just fixed a small typo.
I already though about it and I don't have a "clean" method to propose. I could for instance allocate one for all 5 arrays of n bitsets each and access to the bitsets of level level since the BAB has depth at most n. This way we avoid multiple allocations.
What's the magic commande to profile this code? %prun is not working here. The speed of the Thanks, |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:13
Thanks
Using bitsets that would mean dozens of allocations lines again. What is it that you use in those fast digraphs of yours that are not in the 'binary matrix' type ? Possibly the best is to implement it there and use the binary matrices?
Run a long command, then type 'perf top' in a console. You'll love it.
I will probably write a "profiling tutorial" soon. It would be cool if you were willing to review it. That will be helpful, along with the "interface C code with Sage" tutorial. Nathann |
comment:14
should be something like that
I'm using extensively
Seriously, it would be much cleaner to use bitsets for rows and to call As I said previously, my suggestion is more to change the
Don't have it on OSX :(
According some discussions on the mailing lists, we have some profiling experts that could be of more help than me. I can have a look anyway to tell if it is dummy's level ;) David. |
comment:15
In a design like that there is a problem if some
With bitsets you cannot do this very computation without allocating a third bitset. Okay, let's say that it is not important: could you turn/extend your
We agree if you actually talk of changing the 'binary_matrix' type, which is then used by the static dense graph stuff.
Try it on a real machine. That will give you a reason to install some real OS
The problem with 'profiling experts' is that they don't review those patches, and if nobody does it everybody loses. Nathann |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
Hello, I'm now using a pool of bitsets. I add to use type About changing the It's a pitty I don't have this perf top command on mac. In fact it is not installed on my linux desktop :( Best, |
comment:18
Hello,
Good news !
Could you do it in another patch, then rebase this ticket on top of it ? This way we will not have to discuss code that will be changed afterwards.
Did you try it on a linux machine ? It really tells you all you want to know. Nathann |
comment:19
OK, I will work on it.
I don't have it installed on my linux desktop(s), and since I don't know the package name, yum returns me hundreds of possible packaged containing the keyword "perf". D. |
comment:20
Yo!
Easy. Let us say that this ticket is a branch A. Once the other branch will be written, name it B. git checkout A After this your branch A will be above B.
In debian it is in the package linux-tools. Nathann |
comment:37
Replying to @nathanncohen:
I have change the method and updated calls to it.
Apparently your care a lot about reducing mallocs. I changed it. Replying to @nathanncohen:
Exactly. This will be useful when we will start adding pre-processing.
I succeed to remove it. I have changed the name of some variables and updated the size of
If we reduce the upper bound during the recursive call of the kth element of the list, we want to prune (cut) branches that are no longer useful.
I changed the sentence to
Yep, I have many reasons for not exposing the BAB in the main
I hope I have answered all your comments ;) David. |
Reviewer: Nathann Cohen |
comment:40
Hello,
Having a short code that only does what is needed helps a lot when you try to understand someboy else's code.
Okay I understand. That helps when you split your first graph into subproblems. This being said, the term
Oh I see. I had not noticed that
Okay, as you like. As long as you plan to do it in the short future, you can manage the patches as you like. Nathann_from_Nantes |
comment:41
It is used for both usage: If a lower bound is known, then the user can provide it to the BAB to stop if a solution reaches this bound. It can also be used to say "I'm happy with any solution with cost less than k". I propose to rename it
Right, done.
Let us know if you meet Lulu ;) Thank you again for the review. David. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:43
Yoooooooooooo !
And thank you for the code Nathann |
comment:44
Youhou! |
comment:45
PDF docs don't build |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:47
Should be OK now. |
Changed branch from public/17647b to |
This patch implements a branch and bound algorithm for computing the vertex separation of directed graphs. It can be significantly faster than other methods already implemented. Furthermore, it can handle graphs with more than 31 vertices, but of course the computation time could be long.
Depends on #17665
CC: @nathanncohen
Component: graph theory
Author: David Coudert
Branch/Commit:
dd12f60
Reviewer: Nathann Cohen
Issue created by migration from https://trac.sagemath.org/ticket/17647
The text was updated successfully, but these errors were encountered: