[python-uk] Help Please

Python Freak newtopython at gmail.com
Mon Jan 29 19:09:51 CET 2007


Okay I finally got the adjancency list representation working:

   v = range(1,11)
   al=zip(v[:-1],v[1:])+[(10,)]

Is that right? It works fine.

How do I go from here to creating an incidence list representation and
adjacency matrix? (is it possible to assign to individual items in each
tuple? I guess not).

[ for those of you who missed my earlier email, this is not a homework; i'm
a graduate student attempting to learn python ].


On 1/28/07, Zeth Green <theology at gmail.com> wrote:
>
> On 29/01/07, Michael Sparks <ms at cerenity.org> wrote:
> > Is this homework?
>
> I was about to respond with a literal answer but I thought that too.
> It was the mathematical terminology but especially this bit that made
> me suspect:
>
> > On Sunday 28 January 2007 22:45, Python Freak wrote:
> Hint: You may find it useful to note that one incidence list
> representation is...
> _______________________________________________
> python-uk mailing list
> python-uk at python.org
> http://mail.python.org/mailman/listinfo/python-uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-uk/attachments/20070129/961dc746/attachment.htm 


More information about the python-uk mailing list