Skip to content
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

Static sparse graphs for fast low-level computations #12306

Closed
nathanncohen mannequin opened this issue Jan 13, 2012 · 14 comments
Closed

Static sparse graphs for fast low-level computations #12306

nathanncohen mannequin opened this issue Jan 13, 2012 · 14 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jan 13, 2012

Helloooooo !!

This extensively documented module implements a very basic data structure for graphs that is helpful for EFFICIENT implementations. It was actually used by Sage already in sage.graphs.distances_all_pairs, but it is better to have a proper documentation for such things.

And of course, this does not solve the current lack of a Python-level static graph class, that would handle loops/multiedges and labels... It will come, though :-)

Nathann

Depends on #12235

CC: @dcoudert

Component: graph theory

Keywords: Cernay2012

Author: Nathann Cohen

Reviewer: David Coudert

Merged: sage-5.0.beta5

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

@nathanncohen nathanncohen mannequin added this to the sage-5.0 milestone Jan 13, 2012
@nathanncohen nathanncohen mannequin added the s: needs review label Jan 13, 2012
@dcoudert
Copy link
Contributor

dcoudert commented Feb 3, 2012

comment:2

I'm unable to install the patch on sage-5.0.beta1.

File digraph.py.rej:

--- digraph.py
+++ digraph.py
@@ -2565,18 +2574,24 @@
 
         TESTS:
 
-        Checking against NetworkX::
-
+        Checking against NetworkX, and another of Sage's implementations::
+
+            sage: from sage.graphs.base.static_sparse_graph import strongly_connected_components
             sage: import networkx
             sage: for i in range(100):                                     # long
             ...        g = digraphs.RandomDirectedGNP(100,.05)             # long
             ...        h = g.networkx_graph()                              # long
             ...        scc1 = g.strongly_connected_components()            # long
             ...        scc2 = networkx.strongly_connected_components(h)    # long
+            ...        scc3 = strongly_connected_components(g)             # long
             ...        s1 = Set(map(Set,scc1))                             # long
             ...        s2 = Set(map(Set,scc2))                             # long
+            ...        s3 = Set(map(Set,scc3))                             # long
             ...        if s1 != s2:                                        # long
             ...            print "Ooch !"                                  # long
+            ...        if s1 != s3:                                        # long
+            ...            print "Oooooch !"                               # long
+
         """
 
         try:

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Feb 6, 2012

comment:3

Oopps.. This patch needs #12235 to be applied first, though it is now merged with beta2 :-)

Nathann

@dcoudert
Copy link
Contributor

dcoudert commented Feb 6, 2012

comment:4

I can now install the patch with sage-5.0.beta2.

No compilation error. Generation of the documentation is OK.

However, can you improve in section What does it take as input? the n^2sizeof(...) and the nsizeof(...). For instance you can add a \cdot between n and sizeof(...).

For functions returning a dictionnary of dictionnary, you should add an extra warning recalling that such structures are huge. I'm not sure most of us can use this for graphs with 10.000 nodes.

Best,

D.

@dcoudert
Copy link
Contributor

dcoudert commented Feb 6, 2012

Reviewer: David Coudert

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Feb 6, 2012

comment:5

Here it is !!! :-)

I also removed some trailing whitespaces, as I learned here that they were evil :-P

Nathann

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Feb 6, 2012

Changed keywords from none to Cernay2012

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Feb 6, 2012

Attachment: trac_12306_doc.patch.gz

@dcoudert
Copy link
Contributor

dcoudert commented Feb 6, 2012

comment:6

I can install both patch correctly and the documentation is now well presented and with enough details.

Good work !

D.

PS: what's the relation between this patch and the Cernay 2012 Music Festival ? ;-)

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Feb 6, 2012

comment:7

PS: what's the relation between this patch and the Cernay 2012 Music Festival ? ;-)

Some snow, and around 10 people in a tower coding Sage patches on their computers :-)

http://wiki.sagemath.org/combinat/SageCombinatDaysCernay2012

Nathann

@jdemeyer
Copy link

jdemeyer commented Feb 6, 2012

Changed dependencies from 12235 to #12235

@jdemeyer
Copy link

comment:9

Please fix the commit message of the first patch.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Feb 15, 2012

Attachment: trac_12306.patch.gz

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Feb 15, 2012

comment:10

Gloops... Done ! ^^;

Nathann

@jdemeyer
Copy link

Merged: sage-5.0.beta5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants