Re: [sage-support] Re: edges in graphs

2011-02-07 Thread Johannes
yea. it's connected. i tried the spanning trees too, but I had to look ob how the trees differ, depending on how they are build. I've just one small (opticial) problem remaining. if I plot the tree all vertices are ordert on each level but beacause of this many lines are crossing. I dont need to

Re: [sage-support] Re: edges in graphs

2011-02-07 Thread Nathann Cohen
Hello !!! Among the wealth of tricky options one can use in plot/show, you will find : g.plot(layout='tree') :-) Nathann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more

Re: [sage-support] Re: edges in graphs

2011-02-07 Thread Johannes
Yea, sure. but my problem is a tree like this: 1 / \ 23 45 and so on. but i don't need it in that order I have a few crossing edes in it and I'd like to have one like 1 / \ 35 24 or 1 / \ 25 34 or someting like that, such that i have just a minimal number of crosssings. even

Re: [sage-support] Re: edges in graphs

2011-02-05 Thread Johannes
thnx for your answers. I'm dealing with an undirectred graph. In the beginning I have a given number of vertices (53 in my case now) and a list or relations between them. All I do is adding a new edge (a - b) if a is in relatoin to be. My problem is, i dont know form the beginning if it's

Re: [sage-support] Re: edges in graphs

2011-02-05 Thread Luiz Felipe Martins
Sorry, I didn't get the beginning of the thread, but if you need the graph without loops, it is a tree. So, you can compute a maximal spanning tree of the graph, and see if you get the whole graph together. This will also tell you what edges to remove, if the graph is not a tree. Of course, the

Re: [sage-support] Re: edges in graphs

2011-02-05 Thread Luiz Felipe Martins
Oh, I was imprecise. If it has no loops, it is a forest. So you have to get a spanning tree for each component. On Sat, Feb 5, 2011 at 10:01 AM, Luiz Felipe Martins luizfelipe.mart...@gmail.com wrote: Sorry, I didn't get the beginning of the thread, but if you need the graph without loops, it

[sage-support] Re: edges in graphs

2011-02-04 Thread Nathann Cohen
how can i add a new edge (a-b) to a given graph G (n.n. connected), just in the case that there is no path (a - ... - b) before? From your question, I can not infer whether you are dealing with directed or undirected graphs. So just in case : - If your graph is undirected and there are no