Hi,I think I have found a serious bug on Graph.modular_decomposition. Clearly, a graph is prime if and only if its complement is so. Nevertheless:
sage: P = Graph('Dl_')
sage: P.is_prime()
True
sage: P.complement().is_prime()
FalseThis behaviour seems to derive from Graph.modular_decomposition. Look:
sage: P.modular_decomposition()
('Prime', [2, 0, 4, 1, 3])
sage: P.complement().modular_decomposition()
('Prime', [('Serie', [3, 1]), 4, 0, 2])This is not the only example where you can observe this behavior. To generate easily many examples try, for instance:
sage: for g in graphs(7):
....: if g.is_prime() and not g.complement().is_prime():
....: g.graph6_string()
....:
'Fl_K?'
'FlGK?'
'FlSK?'
'FnsK?'
'Fl[K?'
'FheL?'
'FlUL?'
'F|UL?'
'Fl]L?'
'FlsKG'
'FlUKG'
'FluKG'
'FnV[G'
'FlT[G'
'F|tkG'
'Fl]KG'
'Fl[KW'
'Fn|KG'
'Fn|kG'
'F|LLG'
'FnnLG'
'Flg[?'
'F|g[?'
'Fli[?'
'Flg{?'
'Fn{[?'
'Fn}[?'
'FzN{?'
'F~H[?'Best regards,
Paulo
Oh. Well, perhaps you need to do something like "touch modular_decomposition.pyx" when you are in the sage/graphs/modular_decomposition folder. Then run "sage -b". modular_decomposition.pyx is the actual Sage code, that depends on the .c file you modified. It should be enough. Tell me how it goes !! I will keep this thread updated about the fix.
Nathann
Nathann