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

is_cartesian_product #12917

Closed
nathanncohen mannequin opened this issue May 6, 2012 · 9 comments
Closed

is_cartesian_product #12917

nathanncohen mannequin opened this issue May 6, 2012 · 9 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented May 6, 2012

This patch implements a new method that lets one recognize whether a graph can be written as the cartesian products of some others. A new module is created because the documentation is rather long, and because the first aim was to write the method much more efficiently, at a much lower level.

As usual, the patch would be much harder to review if it were done all at once, and we would need two versions anyway to check the correction of the trickier algorithm.

The aim of this patch is also to obtain better plots of very symmetrical graphs.

Nathann

CC: @wdjoyner @dimpase @rbeezer

Component: graph theory

Author: Nathann Cohen

Reviewer: David Coudert

Merged: sage-5.2.beta0

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

@nathanncohen nathanncohen mannequin added this to the sage-5.1 milestone May 6, 2012
@nathanncohen nathanncohen mannequin added p: major / 3 labels May 6, 2012
@dcoudert
Copy link
Contributor

dcoudert commented Jun 2, 2012

Reviewer: David Coudert

@dcoudert
Copy link
Contributor

dcoudert commented Jun 2, 2012

comment:2

Hello,

I'm unable to install the patch with sage.5.1.beta1.

--- generic_graph.py
+++ generic_graph.py
@@ -13093,25 +13093,33 @@
     def cartesian_product(self, other):
         """
         Returns the Cartesian product of self and other.
-        
+
         The Cartesian product of `G` and `H` is the graph `L` with vertex set
         `V(L)` equal to the Cartesian product of the vertices `V(G)` and `V(H)`,
         and `((u,v), (w,x))` is an edge iff either - `(u, w)` is an edge of
         self and `v = x`, or - `(v, x)` is an edge of other and `u = w`.
-        
-        EXAMPLES::
-        
+
+        .. SEEALSO::
+
+            - :meth:`~sage.graphs.graph_decompositions.graph_products.is_cartesian_product`
+              -- factorization of graphs according to the cartesian product
+
+            - :mod:`~sage.graphs.graph_decompositions.graph_products`
+              -- a module on graph products.
+
+        EXAMPLES::
+
             sage: Z = graphs.CompleteGraph(2)
             sage: C = graphs.CycleGraph(5)
             sage: P = C.cartesian_product(Z); P
             Graph on 10 vertices
             sage: P.plot() # long time
-        
-        ::
-        
+
+        ::
+
             sage: D = graphs.DodecahedralGraph()
             sage: P = graphs.PetersenGraph()
-            sage: C = D.cartesian_product(P); C    
+            sage: C = D.cartesian_product(P); C
             Graph on 200 vertices
             sage: C.plot() # long time
         """

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 2, 2012

comment:3

Updated ! It probably needed a rebase after your patch on graph products got merged ! ;-)

Nathann

@dcoudert
Copy link
Contributor

dcoudert commented Jun 2, 2012

comment:4

The patch is working perfectly (install, tests, functionality, docbuild and display). Nice work!

In another patch, one should do the same for digraphs.

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 2, 2012

comment:5

Wouhouuuuuuuu !! Thanks !

I am not sure the algorith would work for digraphs though.. Or it is probably easier, I do not know :-)

Nathann

@jdemeyer
Copy link

jdemeyer commented Jun 9, 2012

comment:6

Please fill in your real name in the Author / Reviewer fields.

@dcoudert
Copy link
Contributor

dcoudert commented Jun 9, 2012

Author: Nathann Cohen

@jdemeyer jdemeyer modified the milestones: sage-5.1, sage-5.2 Jun 18, 2012
@jdemeyer
Copy link

Attachment: trac_12917.patch.gz

Rebased to sage-5.1.rc0

@jdemeyer
Copy link

jdemeyer commented Jul 2, 2012

Merged: sage-5.2.beta0

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

2 participants