#6660: Error in chromatic_number() and coloring() in the Graph class
--------------------------+-------------------------------------------------
 Reporter:  ncohen        |       Owner:  rlm       
     Type:  defect        |      Status:  new       
 Priority:  major         |   Milestone:  sage-4.1.1
Component:  graph theory  |    Keywords:            
 Reviewer:                |      Author:            
   Merged:                |  
--------------------------+-------------------------------------------------
 The following code creates a Graph and computes its chromatic number :

 sage: h=Graph(":I`ASWCaG`WaJC{afP")

 sage: h.chromatic_number()

 4

 sage: h.coloring()

 [[6, 8], [9], [0, 4, 7, 3], [1, 2, 5]]

 Meanwhile, you can check that the coloring [[3, 9, 1], [9, 4, 0, 3], [3,
 8, 5]] is valid with this code that checks that each class is actually an
 independent set.
 :

 for c in [[3, 9, 1], [9, 4, 0, 3], [3, 8, 5]]:

       print h.subgraph(c).connected_components_number()==len(c)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6660>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
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-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to