Hello !!!
The two coloring functions are meant to output a number when the user
is just interested in the number of classes, but the most "natural"
behaviour for these functions is to output a partition of the vertices
( of the edges ) such that each class is an independent set. As the
former coloring function included a different output ( see keyword
hex_colors=True ) so that everything is well displayed in the plot
command ( it output a dictionary whose keys are colors and values are
sets of vertices/edges ), I added this output to the functions too.
In your situation, you tell me you would like the functions to input
nothing but to place the id of the classes on each of the vertices ?
To obtain the information you mention, you can use a dictionary for
example :
classes=g.vertex_coloring()
dic={}
for (c,id) in zip(classes,range(len(classes))):
for v in c:
dic[v]=i
This way your dictionary associates to each vertex its color, which
seem to be in your case a better type of output ;-)
By the way, I am kind of studying graph theory, which includes a LOT
of colorings. If you have any theoretical question on this subject I'd
be glad to think about it :-)
Nathann
On Oct 31, 11:55 pm, David Joyner <
wdjoy...@gmail.com> wrote: