ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 30 Mar 2019 18:56:30 +0100Create program to find which graphs contain specific subgraphhttps://ask.sagemath.org/question/45952/create-program-to-find-which-graphs-contain-specific-subgraph/ Hello, I am pretty new to Sage, and am discovering all the wonderful things it can do. I know how to ask Sage to generate a list of graphs that satisfy particular properties. To do this I "call" a program named "nauty". For example, if I would like to generate all graphs with 10 vertices, 25 edges, and clique number 4 I type the following:
sage: g10=[g for g in graphs.nauty_geng('10 25') if g.clique_number()==4]
Now say that I want to check which of these graphs contain a particular subgraph. For example, say I want to know which one of these graphs contain a 5-cycle. How can I ask Sage to go through the list of graphs in g10 and tell me this information?
Thank you in advance!merluzaSat, 30 Mar 2019 18:56:30 +0100https://ask.sagemath.org/question/45952/Building Graphs with Specific Properties Using Sagehttps://ask.sagemath.org/question/45944/building-graphs-with-specific-properties-using-sage/I would like to use Sage to build graphs with particular properties. I know how to call a program called "nauty" to ask Sage to generate, for example, all graphs on 8 vertices with 16 edges with clique number 4. However, I would like to add more properties.
Is it possible to have Sage generate all graphs with clique number 4 so that all vertices that are contained in a 4-clique satisfy a minimum degree condition? Or is it in general possible to have a particular subset of vertices satisfy a degree condition?
Thank you.merluzaFri, 29 Mar 2019 21:32:22 +0100https://ask.sagemath.org/question/45944/