sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.48k stars 488 forks source link

Simplify generation of some basic graphs #18530

Closed dcoudert closed 9 years ago

dcoudert commented 9 years ago

Avoid calling networkx and then converting to sage graphs for generating very simple graphs (Bull graph, Claw Graph, etc.)

CC: @nathanncohen

Component: graph theory

Author: David Coudert

Branch/Commit: 347e681

Reviewer: Nathann Cohen

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

dcoudert commented 9 years ago

Branch: public/18530

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

59fcce0trac #18530: Cycle Graph
91fb0b6trac #18530: Complete Graph
7c07d50trac #18530: Diamond Graph
080d428trac #18530: House Graph
c581ca0trac #18530: House X Graph
6b437aftrac #18530: Star Graph
55a5cbbtrac #18530: Path Graph
842658dtrac #18530: Complete Bipartite Graph
deec0b6trac #18530: Circular Ladder Graph
0e52730trac #18530: Grid 2d Graph
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Commit: 0e52730

dcoudert commented 9 years ago
comment:3

I did some of them. I don't know if we need to do all of them yet ;)

videlec commented 9 years ago
comment:4

Hi,

Trac ticket #18530 -> :trac:`18530`

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

8ead714trac #18530: review
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 0e52730 to 8ead714

dcoudert commented 9 years ago
comment:6

Right.

dcoudert commented 9 years ago
comment:7

does not pass all tests :( The order of the vertices changed in Grid2dGraph.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 8ead714 to b1a5741

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

2179393trac #18530: better (Circular) Ladder Graph
b1a5741trac #18530: a Path Graph of order 1 has a vertex
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from b1a5741 to b0936f3

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

79d91f5trac #18530: fix some issues
325c978trac #18530: further cleaning
2547d93trac #18530: resolve tests in digraph.py
b0936f3trac #18530: resolve tests in generic_graph.py
dcoudert commented 9 years ago
comment:10

Thanks to Nathann, I have solve all the problems.

I have not changed all the methods and there is room for further cleaning, but it's a beginning.

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 9 years ago
comment:11

Helloooooooooo !

I added a commit at public/18530 (since you chose to make the branch public).

Most of the changes I made are superficial:

I also fixed a bug with ladder_graph, which was incorrect (plot it, you will see).

Most importantly, if you have never looked at paths, now is the time:

sage: graphs.PathGraph(3).show()
sage: graphs.PathGraph(30).show()
sage: graphs.PathGraph(100).show()

Run those three commands. You will be surprised :-P

Nathann

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

2559809trac #18530: Merged with 6.8.beta2
9a7caeetrac #18530: Reviewer' s commit
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from b0936f3 to 9a7caee

dcoudert commented 9 years ago
comment:13

Thanks for the corrections.

I had to update some doctests since you changed from Path Graph to Path graph. I had also to update the test on spring_layout in generic_graph.py line 15174.

And yes, the layout of the path is pretty cool ;)

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Changed commit from 9a7caee to 347e681

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 9 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

347e681trac #18530: update doc tests in generic_graph.py
6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 9 years ago
comment:15

Hmmmmmm O_o

Actually I did not mean to make that change (I just copy/pasted the first of your two lines) but it seems that all other graphs has a 'graph' and not a 'Graph', so I guess that's fine O_o

Nathnn

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 9 years ago
comment:16

(and sorry for the broken doctests)

dcoudert commented 9 years ago
comment:17

You are welcome ;)

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 9 years ago
comment:18

Wellll, then....

6bdad4c1-1e26-4f2f-a442-a01a2292c181 commented 9 years ago

Reviewer: Nathann Cohen

dcoudert commented 9 years ago
comment:19

Thanks.

vbraun commented 9 years ago

Changed branch from public/18530 to 347e681