-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Immutable graph backend #14806
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Dependencies: #14806 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:8
|
comment:9
Hello !
I obviously chosed the "Thou shalt not add a vertex to an immutable graph".
I change my mind so often that I wouldn't put it beyond reach. But just to please you I fixed it
Well, I defined the "INPUT" where it was not, but usually the outputs are pretty clear... Not to mention that those are rather meant to Sage developpers.
It's a poetic license.
That it uses static sparse graphs as a data structure. By the way, the link and the name did not match. I rephrased it.
There were arguments there before I learnt that Sage existed, and it is because this method can also be used through
You have no idea how many hours I wasted on that. Unfortunately, you are right. I reversed those modifications and both keywords can now be used. Patch updated ! Nathann |
comment:10
Hello! As promised I peeked at the code!! In general the patch looks good to me with the exception of the above comments.
|
comment:11
Cython detects "for i in range(n)" loops and replaces them with a C loop. So there is no point in using xrange. |
comment:12
Hellooooooo !!
Cooooooooooool !
Volker beat me to this one.
You are right. Fixed.
Because I am an idiot. It actually explains a lot of things Fiiiiiiiiixed ! Nathann |
comment:13
Good! As far as I am concerned the code is good to go! Do you want me to review it positively or wish for another less confused soul to review it as well? ...as for xrange/range... I can see the reason for using range to be compatible with Python 3.x but somehow I am afraid the transition will never happen :-) |
comment:14
Well... For me the code is good to go too, so if you agree with it I would be glad to see it in Sage ! Not to mention that I wrote this patch because of #14806, and that those guys will probably want to use it for their own dark ends once it will be merged As for Python 3, I don't know. It feels like it may take forever to move there, but then again things happened very efficiently to move to git, sooo... Well. Sage devs are surprising guys Nathann |
Reviewer: Jernej Azarija |
comment:16
Wow. THaaaaaaaaaaaaaaaaaanks ! Nathann |
comment:17
This needs to be rebased to sage-5.12.beta2. |
comment:18
Attachment: sparselabel.patch.gz Done ! |
Merged: sage-5.12.beta4 |
comment:20
Merci Nathann! |
comment:21
Maintenant pour me remercier faut l'utiliser, genre pour me convaincre que je ne l'ai pas codé pour rien Nathann |
As the title says, this patch implements a data structure atop of the current "static sparse graphs" which can be used as a backend for a Sage Graph. Smaller in memory, and faster.
The patch :
sparse
keyword todata_structure
which can now be set tosparse,dense
orstatic_sparse
(and others later)I tested this patch in many many ways, and in particular by adding at the end of graph/digraph
__init__
method the following two lines:This being said, many graph methods will break when the backend is static. The most obvious ones are add/remove vertex/edges, but other methods will break which supposed that any graph can be modified. For methods which do not modify the graph itself, this happens when it creates a temporary copy of it (which will use the same backend), and feel free to change that one.
I don't see an automatic way to spot them, I don't think it is very bad as this static backend is a new feature and hence will not break any existing code, and this patch is already very long (and hard to review) as it is
^^;
Nathann
Depends on #14805
CC: @dimpase @sagetrac-azi @sagetrac-Slani @simon-king-jena @vbraun @sagetrac-Stefan @nthiery @hivert
Component: graph theory
Author: Nathann Cohen
Reviewer: Jernej Azarija
Merged: sage-5.12.beta4
Issue created by migration from https://trac.sagemath.org/ticket/14806
The text was updated successfully, but these errors were encountered: