Re: [sage-devel] graph isomorphism checking with labeled (or colored) vertices

2012-01-06 Thread Dima Pasechnik
On Friday, 6 January 2012 22:57:24 UTC+8, David Joyner wrote: > > On Fri, Jan 6, 2012 at 9:43 AM, Jason Grout > wrote: > > Hi all, > > > > Is there an easy way to ask if two graphs are isomorphic, respecting some > > coloring or labeling of the vertices? I see the is_isomorphic function > let

Re: [sage-devel] graph isomorphism checking with labeled (or colored) vertices

2012-01-06 Thread Tom Boothby
Jason, I've been working with nonisomorphic colorings recently. I use the following: def canonical_coloring_label(G,c): """ Given a coloring dictionary, {color1 : [u1, u2, ...], color2 : [v1, v2, ... ], ... } return a string which uniquely identifies the isomorph

Re: [sage-devel] graph isomorphism checking with labeled (or colored) vertices

2012-01-06 Thread Nathann Cohen
And if you accept to sligthly change the graph, you can add a universal vertex v to it. If u is of color red, color edge uv with red, and the same for all vertices. Do this in both graph and all will be fine :-) Nathann -- To post to this group, send an email to sage-devel@googlegroups.com To

Re: [sage-devel] graph isomorphism checking with labeled (or colored) vertices

2012-01-06 Thread David Joyner
On Fri, Jan 6, 2012 at 9:43 AM, Jason Grout wrote: > Hi all, > > Is there an easy way to ask if two graphs are isomorphic, respecting some > coloring or labeling of the vertices?  I see the is_isomorphic function lets I don't know if this is easy or not but here is an idea: First, suppose you ha

[sage-devel] graph isomorphism checking with labeled (or colored) vertices

2012-01-06 Thread Jason Grout
Hi all, Is there an easy way to ask if two graphs are isomorphic, respecting some coloring or labeling of the vertices? I see the is_isomorphic function lets you respect edge labels, so I guess I could attach a new vertex to, say, all "blue" vertices, and label each of the edges to this new