An improved Graph class
The graph_improved
module defines
the GraphImproved
class, which represents
a Graph and some of its computed properties, such as its clique polynomial.
AUTHORS:
Paul Leopardi (2016-10-05): initial version
- class boolean_cayley_graphs.graph_improved.GraphImproved(graph=None, **kwargs)[source]
Bases:
sage.graphs.graph.Graph
,boolean_cayley_graphs.saveable.Saveable
A Graph and some of its computed properties, such as its clique polynomial.
The constructor is based on the
Graph
constructor and takes the same arguments.EXAMPLES:
sage: P = graphs.PetersenGraph() sage: P.clique_polynomial() 15*t^2 + 10*t + 1 sage: from boolean_cayley_graphs.graph_improved import GraphImproved sage: PI = GraphImproved(P) sage: PI.stored_clique_polynomial 15*t^2 + 10*t + 1 sage: dir = tmp_dir() sage: PI.save_mangled('PetersenGraph', dir=dir) sage: LPI = GraphImproved.load_mangled('PetersenGraph', dir=dir) sage: LPI.stored_clique_polynomial 15*t^2 + 10*t + 1 sage: GraphImproved.remove_mangled('PetersenGraph', dir=dir) sage: os.rmdir(dir)
TESTS:
sage: from boolean_cayley_graphs.graph_improved import GraphImproved sage: P = graphs.PetersenGraph() sage: PI = GraphImproved(P) sage: print(PI) Petersen graph sage: from boolean_cayley_graphs.graph_improved import GraphImproved sage: P = graphs.PetersenGraph() sage: PI = GraphImproved(P) sage: latex(PI) \begin{tikzpicture} \definecolor{cv0}{rgb}{0.0,0.0,0.0} \definecolor{cfv0}{rgb}{1.0,1.0,1.0} \definecolor{clv0}{rgb}{0.0,0.0,0.0} ... \definecolor{cv6v8}{rgb}{0.0,0.0,0.0} \definecolor{cv6v9}{rgb}{0.0,0.0,0.0} \definecolor{cv7v9}{rgb}{0.0,0.0,0.0} % ... % \Edge[lw=0.1cm,style={color=cv0v1,},](v0)(v1) \Edge[lw=0.1cm,style={color=cv0v4,},](v0)(v4) \Edge[lw=0.1cm,style={color=cv0v5,},](v0)(v5) ... \Edge[lw=0.1cm,style={color=cv6v8,},](v6)(v8) \Edge[lw=0.1cm,style={color=cv6v9,},](v6)(v9) \Edge[lw=0.1cm,style={color=cv7v9,},](v7)(v9) % \end{tikzpicture}