On 7/27/10 1:41 AM, Nathann Cohen wrote:
Hello everybody !!!!
I have a small problems with graphs => I would like to be able to talk
about a Z/2Z vector space defined over its edges (any set of edges is
independent)
Of course I can just create a Z/2Z vector space of dimension G.size()
(number of edges), but this would later mean that I constantly have to
keep track of which edge is represented by [ 0 0 0 .... 0 1 0 ... 0 ].
Is there any nice way to define elements of a VectorSpace from an edge
without having to build dictionaries in bth way (as soon as something
is computed using the vector space, one would need to "convert" the
result to have it in term of edges)..
It sounds like you are just wanting an order on the edges. If you can
easily compute the index of an edge, you're set (that's the coordinate
of the edge). However, if your problem does not lend itself to that, it
sounds like the easiest thing to do is to maintain dicts to map between
an edge and its coordinate.
Of course, you can label the edge with it's coordinate vector, right?
There's your map going to the vector space. Coming from the vector
space probably requires the dict.
Thanks,
Jason
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org