Re: Graph library for Python

2009-12-13 Thread Tiago de Paula Peixoto
On 12/13/2009 08:32 AM, anand jeyahar wrote: > A crucial element in this hypothetical module would be the main graph > data structure. The simplest approach would be to implement it in pure > python, with lists, dicts and such, as many libraries do. However, this > would rule out it

Re: Graph library for Python

2009-12-13 Thread anand jeyahar
While I agree, I think it's going to be extremely difficult to get any > kind of buy in without a great deal of support from within python. > Any devs willing to throw the time required into this? > > Geremy Condra > -- > http://mail.python.org/mailman/listinfo/python-list > yep i am interested.

Re: Graph library for Python

2009-12-13 Thread geremy condra
On Sun, Dec 13, 2009 at 3:38 AM, Terry Reedy wrote: > geremy condra wrote: > >> Well, I've just concluded a short conversation with Raymond Hettinger, >> and I think its fair to characterize him as being opposed to the idea >> at present. In addition to the popularity test, he's also noted that >>

Re: Graph library for Python

2009-12-13 Thread Terry Reedy
geremy condra wrote: Well, I've just concluded a short conversation with Raymond Hettinger, and I think its fair to characterize him as being opposed to the idea at present. In addition to the popularity test, he's also noted that ideally a core CPython dev should be involved in the project. Put

Re: Graph library for Python

2009-12-12 Thread geremy condra
On Thu, Dec 10, 2009 at 10:57 AM, Bearophile wrote: > Geremy Condra: > >> is there a particular way you want your attribution line to read? > > You can just use my nickname (in all lowercase), with the list of > parts you have used. Don't worry. > > >> Well, we all seem to have reinvented the whee

Re: Graph library for Python

2009-12-12 Thread Tiago de Paula Peixoto
On 12/10/2009 01:57 PM, Bearophile wrote: > Geremy Condra: >> Well, we all seem to have reinvented the wheel differently ;) > > Maybe also because they are designed for different purposes. This is true. For instance, the data structures and most algorithms in graph-tool are implemented in C++ to

Re: Graph library for Python

2009-12-10 Thread Bearophile
Geremy Condra: > is there a particular way you want your attribution line to read? You can just use my nickname (in all lowercase), with the list of parts you have used. Don't worry. > Well, we all seem to have reinvented the wheel differently ;) Maybe also because they are designed for differ

Re: Graph library for Python

2009-12-10 Thread geremy condra
On Thu, Dec 10, 2009 at 7:48 AM, Tiago de Paula Peixoto wrote: > On 12/08/2009 01:27 PM, Robin Becker wrote: >> I don't want to sound pessimistic, but graph and digraph theory has a >> lot of history, especially in computer science. There are already very >> many implementations eg >> >> http://co

Re: Graph library for Python

2009-12-10 Thread geremy condra
On Thu, Dec 10, 2009 at 5:18 AM, Bearophile wrote: > geremy condra: > >> Since that's released under the python license, I'm going to >> go ahead and commit the version that includes the topo >> traversal, but if you have any objections you only need to >> say the word and I'll take it down. > > N

Re: Graph library for Python

2009-12-10 Thread Tiago de Paula Peixoto
On 12/08/2009 01:27 PM, Robin Becker wrote: > I don't want to sound pessimistic, but graph and digraph theory has a > lot of history, especially in computer science. There are already very > many implementations eg > > http://code.google.com/p/igraph > http://www.boost.org/doc/libs/release/libs/gr

Re: Graph library for Python

2009-12-10 Thread Bearophile
geremy condra: > Since that's released under the python license, I'm going to > go ahead and commit the version that includes the topo > traversal, but if you have any objections you only need to > say the word and I'll take it down. No objections :-) Bye, bearophile -- http://mail.python.org/m

Re: Graph library for Python

2009-12-09 Thread geremy condra
On Wed, Dec 9, 2009 at 11:09 PM, geremy condra wrote: > On Wed, Dec 9, 2009 at 8:59 PM, Bearophile wrote: >> Robin Becker: >> >>> There are already very many implementations eg >>> >>> http://code.google.com/p/igraphhttp://www.boost.org/doc/libs/release/libs/graphhttp://ernst-schroeder.uni.lu/Dig

Re: Graph library for Python

2009-12-09 Thread geremy condra
On Wed, Dec 9, 2009 at 8:59 PM, Bearophile wrote: > Robin Becker: > >> There are already very many implementations eg >> >> http://code.google.com/p/igraphhttp://www.boost.org/doc/libs/release/libs/graphhttp://ernst-schroeder.uni.lu/Digraph/doc/http://code.google.com/p/python-graphhttp://compbio.w

Re: Graph library for Python

2009-12-09 Thread Bearophile
Robin Becker: > There are already very many implementations eg > > http://code.google.com/p/igraphhttp://www.boost.org/doc/libs/release/libs/graphhttp://ernst-schroeder.uni.lu/Digraph/doc/http://code.google.com/p/python-graphhttp://compbio.washington.edu/~zach/py_graph/doc/html/public/py_graph...

Re: Graph library for Python

2009-12-09 Thread geremy condra
>> Generally, we've tried to discourage people from instantiating >> nodes and edges directly, in favor of having them controlled >> through the graph. Maybe something along the lines of: >> >> g = Graph(nodes=['a', 'b', 'c'], edges=[('a', 'b'), ('a', 'c'), ('b', 'c')]) >> >> ? > > That would work

Re: Graph library for Python

2009-12-09 Thread geremy condra
On Wed, Dec 9, 2009 at 7:02 PM, Rhodri James wrote: > On Wed, 09 Dec 2009 23:42:13 -, geremy condra > wrote: > >> On Wed, Dec 9, 2009 at 6:04 PM, Rhodri James >> wrote: >>> >>> On Wed, 09 Dec 2009 03:47:03 -, geremy condra >>> wrote: > g = Graph(   nodes={'a':{'colour':'red'},

Re: Graph library for Python

2009-12-09 Thread Patrick Laban
On Wed, Dec 9, 2009 at 4:02 PM, Rhodri James wrote: > > Here's a thought: are > > g.add_edge("a", "b", "ab") > > and > > g.add_edge("a", "b", name="ab") > > equivalent? If so, there's no reason not to have both forms of the > initialiser. If not, that weighs against having 'name' as a dictiona

Re: Graph library for Python

2009-12-09 Thread M.-A. Lemburg
geremy condra wrote: > On Mon, Dec 7, 2009 at 6:28 PM, M.-A. Lemburg wrote: * Graph.__init__ should be able to take a list or set of nodes and edges as initializer >>> >>> The format of this will need to be thought all the way >>> through before being implemented. To date, we haven't

Re: Graph library for Python

2009-12-09 Thread Rhodri James
On Wed, 09 Dec 2009 23:42:13 -, geremy condra wrote: On Wed, Dec 9, 2009 at 6:04 PM, Rhodri James wrote: On Wed, 09 Dec 2009 03:47:03 -, geremy condra wrote: g = Graph( nodes={'a':{'colour':'red'}, 'b':{'colour':'white'}, 'c':{'colour':'blue'}},

Re: Graph library for Python

2009-12-09 Thread geremy condra
On Wed, Dec 9, 2009 at 6:04 PM, Rhodri James wrote: > On Wed, 09 Dec 2009 03:47:03 -, geremy condra > wrote: > >> On Tue, Dec 8, 2009 at 8:42 PM, Rhodri James >> wrote: >>> >>> g = Graph( >>>   nodes=[Node("a", colour="red"), >>>          Node("b", colour="white"), >>>          Node("c", col

Re: Graph library for Python

2009-12-09 Thread Rhodri James
On Wed, 09 Dec 2009 03:47:03 -, geremy condra wrote: On Tue, Dec 8, 2009 at 8:42 PM, Rhodri James wrote: g = Graph( nodes=[Node("a", colour="red"), Node("b", colour="white"), Node("c", colour="blue")], edges=[Edge("a", "b", "ab", weight=2), Edge("a",

Re: Graph library for Python

2009-12-08 Thread geremy condra
On Tue, Dec 8, 2009 at 8:42 PM, Rhodri James wrote: > On Tue, 08 Dec 2009 04:28:05 -, geremy condra > wrote: > >> On Mon, Dec 7, 2009 at 6:28 PM, M.-A. Lemburg wrote: > >>> I wasn't thinking of anything clever :-) ... >>> >>> g = Graph( >>>     [Node("a"), Node("b"), Node("c")], >>>     [Edg

Re: Graph library for Python

2009-12-08 Thread Rhodri James
On Tue, 08 Dec 2009 04:28:05 -, geremy condra wrote: On Mon, Dec 7, 2009 at 6:28 PM, M.-A. Lemburg wrote: I wasn't thinking of anything clever :-) ... g = Graph( [Node("a"), Node("b"), Node("c")], [Edge(Node("a"), Node("b"), "ab"), Edge(Node("a"), Node("c"), "ac"),

Re: Graph library for Python

2009-12-08 Thread Carl Banks
On Dec 8, 4:27 am, Robin Becker wrote: > Is there reason to suppose that any one representation of graphs or digraphs > is > so good we need to add it to python? One of them bothered to write a PEP proposing its inclusion? > Even for fairly common algorithms eg Dijkstra's shortest path there d

Re: Graph library for Python

2009-12-08 Thread geremy condra
On Tue, Dec 8, 2009 at 7:27 AM, Robin Becker wrote: > geremy condra wrote: > ... >> >> I don't have a problem with adding this if there's a strong desire for it, >> but at the moment I'm leaning towards a wait-and-see approach, for >> all the reasons you described. >> >> Geremy Condra > >

Re: Graph library for Python

2009-12-08 Thread Steven D'Aprano
On Tue, 08 Dec 2009 03:06:29 -0500, geremy condra wrote: [snip 215 lines of quoted-quoted-quoted-quoted-quoted text] In the future, would you mind trimming the unneeded quoting from your post? There's no need to duplicate the *entire* conversation in *every* post, and it is awfully AOL-like of

Re: Graph library for Python

2009-12-08 Thread Robin Becker
geremy condra wrote: ... I don't have a problem with adding this if there's a strong desire for it, but at the moment I'm leaning towards a wait-and-see approach, for all the reasons you described. Geremy Condra I don't want to sound pessimistic, but graph and digraph theory has a lot

Re: Graph library for Python

2009-12-08 Thread geremy condra
On Mon, Dec 7, 2009 at 11:28 PM, geremy condra wrote: > On Mon, Dec 7, 2009 at 6:28 PM, M.-A. Lemburg wrote: >> geremy condra wrote: >>> On Mon, Dec 7, 2009 at 2:51 PM, M.-A. Lemburg wrote: geremy condra wrote: > How interested are you in a C port of graphine? I haven't had > any sp

Re: Graph library for Python

2009-12-07 Thread geremy condra
On Mon, Dec 7, 2009 at 6:28 PM, M.-A. Lemburg wrote: > geremy condra wrote: >> On Mon, Dec 7, 2009 at 2:51 PM, M.-A. Lemburg wrote: >>> geremy condra wrote: How interested are you in a C port of graphine? I haven't had any specific requests for it, but if its something you need I c

Re: Graph library for Python

2009-12-07 Thread M.-A. Lemburg
geremy condra wrote: > On Mon, Dec 7, 2009 at 2:51 PM, M.-A. Lemburg wrote: >> geremy condra wrote: >>> How interested are you in a C port of graphine? I haven't had >>> any specific requests for it, but if its something you need I >>> can shuffle it towards the top of the to do pile. >> >> There

Re: Graph library for Python (was: Re: python bijection)

2009-12-07 Thread geremy condra
On Mon, Dec 7, 2009 at 5:48 PM, Steven D'Aprano wrote: > On Mon, 07 Dec 2009 17:23:24 -0500, geremy condra wrote: > > >>>  * Graph.__iter__ could be mapped to an iterator using >>>   the fastest traversal method for the graph nodes (ie. order does not >>>   matter, it's only important that all nod

Re: Graph library for Python (was: Re: python bijection)

2009-12-07 Thread Steven D'Aprano
On Mon, 07 Dec 2009 17:23:24 -0500, geremy condra wrote: >>  * Graph.__iter__ could be mapped to an iterator using >>   the fastest traversal method for the graph nodes (ie. order does not >>   matter, it's only important that all nodes are found as fast as >>   possible) > > Again, it seems amb

Re: Graph library for Python (was: Re: python bijection)

2009-12-07 Thread geremy condra
On Mon, Dec 7, 2009 at 2:51 PM, M.-A. Lemburg wrote: > geremy condra wrote: >> How interested are you in a C port of graphine? I haven't had >> any specific requests for it, but if its something you need I >> can shuffle it towards the top of the to do pile. > > There are two main reasons for a C

Graph library for Python (was: Re: python bijection)

2009-12-07 Thread M.-A. Lemburg
geremy condra wrote: > How interested are you in a C port of graphine? I haven't had > any specific requests for it, but if its something you need I > can shuffle it towards the top of the to do pile. There are two main reasons for a C implementation: 1. performance 2. memory footprint These