sage: sage: d = {0: [1,4,5], 1: [2,6], 2: [3,7], 3: [4,8], 4: [9], \
....: 5: [7, 8], 6: [8,9], 7: [9]}
....: sage: G = Graph(d); G
....:
Graph on 10 vertices
sage: sage: G.plot().show() # or G.show()
....:
Launched png viewer for Graphics object consisting of 26 graphics primitives
sage: sage: import networkx
....: sage: K = networkx.complete_bipartite_graph(12,7)
....: sage: G = Graph(K)
....: sage: G.degree()
....:
[7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 12, 12, 12, 12, 12, 12, 12]
sage: sage: s = ':I`AKGsaOs`cI]Gb~'
....: sage: G = Graph(s, sparse=True); G
....:
Looped multi-graph on 10 vertices
sage: sage: G.plot().show() # or G.show()
....:
Launched png viewer for Graphics object consisting of 28 graphics primitives
sage: sage: G = Graph('Ihe\n@GUA')
....:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-7-732afd85eb01> in <module>
----> 1 G = Graph('Ihe\n@GUA')
~/sage/local/lib/python3.7/site-packages/sage/graphs/graph.py in __init__(self, data, pos, loops, format, weighted, data_structure, vertex_labels, name, multiedges, convert_empty_dict_labels_to_None, sparse, immutable)
1141 self.allow_multiple_edges(multiedges if multiedges else False, check=False)
1142 from .graph_input import from_graph6
-> 1143 from_graph6(self, data)
1144
1145 elif format == 'sparse6':
~/sage/local/lib/python3.7/site-packages/sage/graphs/graph_input.py in from_graph6(G, g6_string)
57 raise RuntimeError("the string (%s) seems corrupt: for n = %d, the string is too long"%(ss, n))
58 elif len(m) < expected:
---> 59 raise RuntimeError("the string (%s) seems corrupt: for n = %d, the string is too short"%(ss, n))
60 G.add_vertices(range(n))
61 k = 0
RuntimeError: the string (Ihe) seems corrupt: for n = 10, the string is too short
sage: sage: G = Graph('Ihe\\n@GUA')
....: sage: G.plot().show() # or G.show()
....:
Launched png viewer for Graphics object consisting of 31 graphics primitives
sage: sage: M = Matrix([(0,1,0,0,1,1,0,0,0,0),(1,0,1,0,0,0,1,0,0,0), \
....: (0,1,0,1,0,0,0,1,0,0), (0,0,1,0,1,0,0,0,1,0),(1,0,0,1,0,0,0,0,0,1), \
....: (1,0,0,0,0,0,0,1,1,0), (0,1,0,0,0,0,0,0,1,1),(0,0,1,0,0,1,0,0,0,1), \
....: (0,0,0,1,0,1,1,0,0,0), (0,0,0,0,1,0,1,1,0,0)])
....: sage: M
....:
[0 1 0 0 1 1 0 0 0 0]
[1 0 1 0 0 0 1 0 0 0]
[0 1 0 1 0 0 0 1 0 0]
[0 0 1 0 1 0 0 0 1 0]
[1 0 0 1 0 0 0 0 0 1]
[1 0 0 0 0 0 0 1 1 0]
[0 1 0 0 0 0 0 0 1 1]
[0 0 1 0 0 1 0 0 0 1]
[0 0 0 1 0 1 1 0 0 0]
[0 0 0 0 1 0 1 1 0 0]
sage: sage: G = Graph(M); G
....:
Graph on 10 vertices
sage: sage: G.plot().show() # or G.show()
....:
Launched png viewer for Graphics object consisting of 26 graphics primitives
sage: sage: M = Matrix([(-1, 0, 0, 0, 1, 0, 0, 0, 0, 0,-1, 0, 0, 0, 0),
....: ....: ( 1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 0, 0, 0),
....: ....: ( 0, 1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 0, 0),
....: ....: ( 0, 0, 1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1, 0),
....: ....: ( 0, 0, 0, 1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0,-1),
....: ....: ( 0, 0, 0, 0, 0,-1, 0, 0, 0, 1, 1, 0, 0, 0, 0),
....: ....: ( 0, 0, 0, 0, 0, 0, 0, 1,-1, 0, 0, 1, 0, 0, 0),
....: ....: ( 0, 0, 0, 0, 0, 1,-1, 0, 0, 0, 0, 0, 1, 0, 0),
....: ....: ( 0, 0, 0, 0, 0, 0, 0, 0, 1,-1, 0, 0, 0, 1, 0),
....: ....: ( 0, 0, 0, 0, 0, 0, 1,-1, 0, 0, 0, 0, 0, 0, 1)])
....: sage: M
....:
[-1 0 0 0 1 0 0 0 0 0 -1 0 0 0 0]
[ 1 -1 0 0 0 0 0 0 0 0 0 -1 0 0 0]
[ 0 1 -1 0 0 0 0 0 0 0 0 0 -1 0 0]
[ 0 0 1 -1 0 0 0 0 0 0 0 0 0 -1 0]
[ 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 -1]
[ 0 0 0 0 0 -1 0 0 0 1 1 0 0 0 0]
[ 0 0 0 0 0 0 0 1 -1 0 0 1 0 0 0]
[ 0 0 0 0 0 1 -1 0 0 0 0 0 1 0 0]
[ 0 0 0 0 0 0 0 0 1 -1 0 0 0 1 0]
[ 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 1]
sage: sage: G = Graph(M); G
....:
Graph on 10 vertices
sage: sage: G.plot().show() # or G.show()
....: sage: DiGraph(matrix(2,[0,0,-1,1]), format="incidence_matrix")
....:
Launched png viewer for Graphics object consisting of 26 graphics primitives
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-14-77b37bcdd962> in <module>
1 G.plot().show() # or G.show()
----> 2 DiGraph(matrix(Integer(2),[Integer(0),Integer(0),-Integer(1),Integer(1)]), format="incidence_matrix")
~/sage/local/lib/python3.7/site-packages/sage/graphs/digraph.py in __init__(self, data, pos, loops, format, weighted, data_structure, vertex_labels, name, multiedges, convert_empty_dict_labels_to_None, sparse, immutable)
756 elif format == 'incidence_matrix':
757 from .graph_input import from_oriented_incidence_matrix
--> 758 from_oriented_incidence_matrix(self, data, loops=loops, multiedges=multiedges, weighted=weighted)
759
760 elif format == 'DiGraph':
~/sage/local/lib/python3.7/site-packages/sage/graphs/graph_input.py in from_oriented_incidence_matrix(G, M, loops, multiedges, weighted)
413 continue
414 if len(NZ) != 2:
--> 415 raise ValueError("there must be two nonzero entries (-1 & 1) per column")
416 L = sorted([c[i] for i in NZ])
417 if L != [-1, 1]:
ValueError: there must be two nonzero entries (-1 & 1) per column
sage: sage: g = Graph([(1,3),(3,8),(5,2)])
....: sage: g
....:
Graph on 5 vertices
sage: sage: import igraph # optional - python_igraph
....: sage: g = Graph(igraph.Graph([(1,3),(3,2),(0,2)])) # optional - python_igraph
....: sage: g # optional - python_igraph
....:
Graph on 4 vertices
sage: sage: for g in graphs(4):
....: ....: print(g.degree_sequence())
....:
[0, 0, 0, 0]
[1, 1, 0, 0]
[2, 1, 1, 0]
[3, 1, 1, 1]
[1, 1, 1, 1]
[2, 2, 1, 1]
[2, 2, 2, 0]
[3, 2, 2, 1]
[2, 2, 2, 2]
[3, 3, 2, 2]
[3, 3, 3, 3]
sage: sage: for g in graphs():
....: ....: if g.chromatic_number() > 3:
....: ....: break
....: sage: g.is_isomorphic(graphs.CompleteGraph(4))
....:
True
sage: sage: graphs.[tab] # not tested
....:
File "<ipython-input-19-b9a8bd3b27c1>", line 1
graphs.[tab] # not tested
^
SyntaxError: invalid syntax
sage: sage: G = graphs.PetersenGraph()
....: sage: G.plot().show() # or G.show()
....: sage: G.degree_histogram()
....:
Launched png viewer for Graphics object consisting of 26 graphics primitives
[0, 0, 0, 10]
sage: sage: G.adjacency_matrix()
....:
[0 1 0 0 1 1 0 0 0 0]
[1 0 1 0 0 0 1 0 0 0]
[0 1 0 1 0 0 0 1 0 0]
[0 0 1 0 1 0 0 0 1 0]
[1 0 0 1 0 0 0 0 0 1]
[1 0 0 0 0 0 0 1 1 0]
[0 1 0 0 0 0 0 0 1 1]
[0 0 1 0 0 1 0 0 0 1]
[0 0 0 1 0 1 1 0 0 0]
[0 0 0 0 1 0 1 1 0 0]
sage: sage: S = G.subgraph([0,1,2,3])
....: sage: S.plot().show() # or S.show()
....: sage: S.density()
....:
Launched png viewer for Graphics object consisting of 8 graphics primitives
1/2
sage: sage: G = GraphQuery(display_cols=['graph6'], num_vertices=7, diameter=5)
....: sage: L = G.get_graphs_list()
....: sage: graphs_list.show_graphs(L)
....:
Launched png viewer for Graphics Array of size 3 x 4
sage: sage: M = Matrix( [[0,0],[0,0]] )
....: sage: G = Graph({ 0 : { M : None } })
....:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-24-3f4096333918> in <module>
1 M = Matrix( [[Integer(0),Integer(0)],[Integer(0),Integer(0)]] )
----> 2 G = Graph({ Integer(0) : { M : None } })
~/sage/local/lib/python3.7/site-packages/sage/matrix/matrix0.pyx in sage.matrix.matrix0.Matrix.__hash__ (build/cythonized/sage/matrix/matrix0.c:38650)()
5693 """
5694 if not self._is_immutable:
-> 5695 raise TypeError("mutable matrices are unhashable")
5696 if self.hash != -1:
5697 return self.hash
TypeError: mutable matrices are unhashable
sage: sage: d = {0 : graphs.DodecahedralGraph(), 1 : graphs.FlowerSnark(), \
....: 2 : graphs.MoebiusKantorGraph(), 3 : graphs.PetersenGraph() }
....: sage: d[2]
....:
Moebius-Kantor Graph: Graph on 16 vertices
sage: sage: T = graphs.TetrahedralGraph()
....: sage: T.vertices()
....:
[0, 1, 2, 3]
sage: sage: T.set_vertices(d)
....: sage: T.get_vertex(1)
....:
Flower Snark: Graph on 20 vertices
sage: sage: graph_db_info()
....:
{'graph_data': ['complement_graph6',
'eulerian',
'graph6',
'lovasz_number',
'num_cycles',
'num_edges',
'num_hamiltonian_cycles',
'num_vertices',
'perfect',
'planar'],
'aut_grp': ['aut_grp_size',
'num_orbits',
'num_fixed_points',
'vertex_transitive',
'edge_transitive'],
'degrees': ['degree_sequence',
'min_degree',
'max_degree',
'average_degree',
'degrees_sd',
'regular'],
'misc': ['vertex_connectivity',
'edge_connectivity',
'num_components',
'girth',
'radius',
'diameter',
'clique_number',
'independence_number',
'num_cut_vertices',
'min_vertex_cover_size',
'num_spanning_trees',
'induced_subgraphs'],
'spectrum': ['spectrum',
'min_eigenvalue',
'max_eigenvalue',
'eigenvalues_sd',
'energy']}
sage: sage: Q = GraphQuery(display_cols=['graph6'],num_vertices=7, diameter=5)
....: sage: Q.show()
....:
Graph6
--------------------
F?`po
F?gqg
F@?]O
F@OKg
F@R@o
FA_pW
FEOhW
FGC{o
FIAHo
sage: sage: for g in Q:
....: ....: show(g)
....:
Launched png viewer for Graphics object consisting of 15 graphics primitives
Launched png viewer for Graphics object consisting of 15 graphics primitives
Launched png viewer for Graphics object consisting of 14 graphics primitives
Launched png viewer for Graphics object consisting of 14 graphics primitives
Launched png viewer for Graphics object consisting of 15 graphics primitives
Launched png viewer for Graphics object consisting of 15 graphics primitives
Launched png viewer for Graphics object consisting of 16 graphics primitives
Launched png viewer for Graphics object consisting of 16 graphics primitives
Launched png viewer for Graphics object consisting of 15 graphics primitives
sage: sage: G = graphs.RandomGNP(15,.3)
....: sage: G.show()
....:
Launched png viewer for Graphics object consisting of 47 graphics primitives
sage: sage: G.show3d()
....:
Launched html viewer for Graphics3d Object
sage: sage: from sage.graphs.graph_latex import check_tkz_graph
....: sage: check_tkz_graph() # random - depends on TeX installation
....: sage: latex(G)
....:
Warning: `tkz-graph.sty` is not part of this computer's TeX installation.
This package is required to render graphs in LaTeX.
Warning: `tkz-berge.sty` is not part of this computer's TeX installation.
This package is required to render graphs in LaTeX.
\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{cv1}{rgb}{0.0,0.0,0.0}
\definecolor{cfv1}{rgb}{1.0,1.0,1.0}
\definecolor{clv1}{rgb}{0.0,0.0,0.0}
\definecolor{cv2}{rgb}{0.0,0.0,0.0}
\definecolor{cfv2}{rgb}{1.0,1.0,1.0}
\definecolor{clv2}{rgb}{0.0,0.0,0.0}
\definecolor{cv3}{rgb}{0.0,0.0,0.0}
\definecolor{cfv3}{rgb}{1.0,1.0,1.0}
\definecolor{clv3}{rgb}{0.0,0.0,0.0}
\definecolor{cv4}{rgb}{0.0,0.0,0.0}
\definecolor{cfv4}{rgb}{1.0,1.0,1.0}
\definecolor{clv4}{rgb}{0.0,0.0,0.0}
\definecolor{cv5}{rgb}{0.0,0.0,0.0}
\definecolor{cfv5}{rgb}{1.0,1.0,1.0}
\definecolor{clv5}{rgb}{0.0,0.0,0.0}
\definecolor{cv6}{rgb}{0.0,0.0,0.0}
\definecolor{cfv6}{rgb}{1.0,1.0,1.0}
\definecolor{clv6}{rgb}{0.0,0.0,0.0}
\definecolor{cv7}{rgb}{0.0,0.0,0.0}
\definecolor{cfv7}{rgb}{1.0,1.0,1.0}
\definecolor{clv7}{rgb}{0.0,0.0,0.0}
\definecolor{cv8}{rgb}{0.0,0.0,0.0}
\definecolor{cfv8}{rgb}{1.0,1.0,1.0}
\definecolor{clv8}{rgb}{0.0,0.0,0.0}
\definecolor{cv9}{rgb}{0.0,0.0,0.0}
\definecolor{cfv9}{rgb}{1.0,1.0,1.0}
\definecolor{clv9}{rgb}{0.0,0.0,0.0}
\definecolor{cv10}{rgb}{0.0,0.0,0.0}
\definecolor{cfv10}{rgb}{1.0,1.0,1.0}
\definecolor{clv10}{rgb}{0.0,0.0,0.0}
\definecolor{cv11}{rgb}{0.0,0.0,0.0}
\definecolor{cfv11}{rgb}{1.0,1.0,1.0}
\definecolor{clv11}{rgb}{0.0,0.0,0.0}
\definecolor{cv12}{rgb}{0.0,0.0,0.0}
\definecolor{cfv12}{rgb}{1.0,1.0,1.0}
\definecolor{clv12}{rgb}{0.0,0.0,0.0}
\definecolor{cv13}{rgb}{0.0,0.0,0.0}
\definecolor{cfv13}{rgb}{1.0,1.0,1.0}
\definecolor{clv13}{rgb}{0.0,0.0,0.0}
\definecolor{cv14}{rgb}{0.0,0.0,0.0}
\definecolor{cfv14}{rgb}{1.0,1.0,1.0}
\definecolor{clv14}{rgb}{0.0,0.0,0.0}
\definecolor{cv0v2}{rgb}{0.0,0.0,0.0}
\definecolor{cv0v13}{rgb}{0.0,0.0,0.0}
\definecolor{cv1v8}{rgb}{0.0,0.0,0.0}
\definecolor{cv1v10}{rgb}{0.0,0.0,0.0}
\definecolor{cv1v12}{rgb}{0.0,0.0,0.0}
\definecolor{cv1v14}{rgb}{0.0,0.0,0.0}
\definecolor{cv2v5}{rgb}{0.0,0.0,0.0}
\definecolor{cv2v6}{rgb}{0.0,0.0,0.0}
\definecolor{cv2v7}{rgb}{0.0,0.0,0.0}
\definecolor{cv2v14}{rgb}{0.0,0.0,0.0}
\definecolor{cv3v9}{rgb}{0.0,0.0,0.0}
\definecolor{cv3v13}{rgb}{0.0,0.0,0.0}
\definecolor{cv4v6}{rgb}{0.0,0.0,0.0}
\definecolor{cv4v9}{rgb}{0.0,0.0,0.0}
\definecolor{cv4v11}{rgb}{0.0,0.0,0.0}
\definecolor{cv5v7}{rgb}{0.0,0.0,0.0}
\definecolor{cv5v12}{rgb}{0.0,0.0,0.0}
\definecolor{cv5v14}{rgb}{0.0,0.0,0.0}
\definecolor{cv6v12}{rgb}{0.0,0.0,0.0}
\definecolor{cv6v13}{rgb}{0.0,0.0,0.0}
\definecolor{cv7v12}{rgb}{0.0,0.0,0.0}
\definecolor{cv7v13}{rgb}{0.0,0.0,0.0}
\definecolor{cv8v9}{rgb}{0.0,0.0,0.0}
\definecolor{cv8v10}{rgb}{0.0,0.0,0.0}
\definecolor{cv8v13}{rgb}{0.0,0.0,0.0}
\definecolor{cv8v14}{rgb}{0.0,0.0,0.0}
\definecolor{cv9v11}{rgb}{0.0,0.0,0.0}
\definecolor{cv9v12}{rgb}{0.0,0.0,0.0}
\definecolor{cv9v13}{rgb}{0.0,0.0,0.0}
\definecolor{cv10v14}{rgb}{0.0,0.0,0.0}
\definecolor{cv11v14}{rgb}{0.0,0.0,0.0}
%
\Vertex[style={minimum size=1.0cm,draw=cv0,fill=cfv0,text=clv0,shape=circle},LabelOut=false,L=\hbox{$0$},x=5.0cm,y=1.6717cm]{v0}
\Vertex[style={minimum size=1.0cm,draw=cv1,fill=cfv1,text=clv1,shape=circle},LabelOut=false,L=\hbox{$1$},x=0.3941cm,y=1.4984cm]{v1}
\Vertex[style={minimum size=1.0cm,draw=cv2,fill=cfv2,text=clv2,shape=circle},LabelOut=false,L=\hbox{$2$},x=3.4706cm,y=1.1162cm]{v2}
\Vertex[style={minimum size=1.0cm,draw=cv3,fill=cfv3,text=clv3,shape=circle},LabelOut=false,L=\hbox{$3$},x=3.5613cm,y=4.5421cm]{v3}
\Vertex[style={minimum size=1.0cm,draw=cv4,fill=cfv4,text=clv4,shape=circle},LabelOut=false,L=\hbox{$4$},x=1.9203cm,y=5.0cm]{v4}
\Vertex[style={minimum size=1.0cm,draw=cv5,fill=cfv5,text=clv5,shape=circle},LabelOut=false,L=\hbox{$5$},x=2.5032cm,y=0.0cm]{v5}
\Vertex[style={minimum size=1.0cm,draw=cv6,fill=cfv6,text=clv6,shape=circle},LabelOut=false,L=\hbox{$6$},x=3.0445cm,y=3.2048cm]{v6}
\Vertex[style={minimum size=1.0cm,draw=cv7,fill=cfv7,text=clv7,shape=circle},LabelOut=false,L=\hbox{$7$},x=3.4704cm,y=0.2442cm]{v7}
\Vertex[style={minimum size=1.0cm,draw=cv8,fill=cfv8,text=clv8,shape=circle},LabelOut=false,L=\hbox{$8$},x=1.2499cm,y=2.035cm]{v8}
\Vertex[style={minimum size=1.0cm,draw=cv9,fill=cfv9,text=clv9,shape=circle},LabelOut=false,L=\hbox{$9$},x=2.1548cm,y=3.442cm]{v9}
\Vertex[style={minimum size=1.0cm,draw=cv10,fill=cfv10,text=clv10,shape=circle},LabelOut=false,L=\hbox{$10$},x=0.0cm,y=0.5403cm]{v10}
\Vertex[style={minimum size=1.0cm,draw=cv11,fill=cfv11,text=clv11,shape=circle},LabelOut=false,L=\hbox{$11$},x=0.8443cm,y=3.7805cm]{v11}
\Vertex[style={minimum size=1.0cm,draw=cv12,fill=cfv12,text=clv12,shape=circle},LabelOut=false,L=\hbox{$12$},x=2.2124cm,y=1.6595cm]{v12}
\Vertex[style={minimum size=1.0cm,draw=cv13,fill=cfv13,text=clv13,shape=circle},LabelOut=false,L=\hbox{$13$},x=3.4563cm,y=2.3906cm]{v13}
\Vertex[style={minimum size=1.0cm,draw=cv14,fill=cfv14,text=clv14,shape=circle},LabelOut=false,L=\hbox{$14$},x=1.3299cm,y=1.1024cm]{v14}
%
\Edge[lw=0.1cm,style={color=cv0v2,},](v0)(v2)
\Edge[lw=0.1cm,style={color=cv0v13,},](v0)(v13)
\Edge[lw=0.1cm,style={color=cv1v8,},](v1)(v8)
\Edge[lw=0.1cm,style={color=cv1v10,},](v1)(v10)
\Edge[lw=0.1cm,style={color=cv1v12,},](v1)(v12)
\Edge[lw=0.1cm,style={color=cv1v14,},](v1)(v14)
\Edge[lw=0.1cm,style={color=cv2v5,},](v2)(v5)
\Edge[lw=0.1cm,style={color=cv2v6,},](v2)(v6)
\Edge[lw=0.1cm,style={color=cv2v7,},](v2)(v7)
\Edge[lw=0.1cm,style={color=cv2v14,},](v2)(v14)
\Edge[lw=0.1cm,style={color=cv3v9,},](v3)(v9)
\Edge[lw=0.1cm,style={color=cv3v13,},](v3)(v13)
\Edge[lw=0.1cm,style={color=cv4v6,},](v4)(v6)
\Edge[lw=0.1cm,style={color=cv4v9,},](v4)(v9)
\Edge[lw=0.1cm,style={color=cv4v11,},](v4)(v11)
\Edge[lw=0.1cm,style={color=cv5v7,},](v5)(v7)
\Edge[lw=0.1cm,style={color=cv5v12,},](v5)(v12)
\Edge[lw=0.1cm,style={color=cv5v14,},](v5)(v14)
\Edge[lw=0.1cm,style={color=cv6v12,},](v6)(v12)
\Edge[lw=0.1cm,style={color=cv6v13,},](v6)(v13)
\Edge[lw=0.1cm,style={color=cv7v12,},](v7)(v12)
\Edge[lw=0.1cm,style={color=cv7v13,},](v7)(v13)
\Edge[lw=0.1cm,style={color=cv8v9,},](v8)(v9)
\Edge[lw=0.1cm,style={color=cv8v10,},](v8)(v10)
\Edge[lw=0.1cm,style={color=cv8v13,},](v8)(v13)
\Edge[lw=0.1cm,style={color=cv8v14,},](v8)(v14)
\Edge[lw=0.1cm,style={color=cv9v11,},](v9)(v11)
\Edge[lw=0.1cm,style={color=cv9v12,},](v9)(v12)
\Edge[lw=0.1cm,style={color=cv9v13,},](v9)(v13)
\Edge[lw=0.1cm,style={color=cv10v14,},](v10)(v14)
\Edge[lw=0.1cm,style={color=cv11v14,},](v11)(v14)
%
\end{tikzpicture}
sage: sage: G = graphs.PetersenGraph()
....: sage: {G:1}[G]
....:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-34-f2fe9aaf41b1> in <module>
1 G = graphs.PetersenGraph()
----> 2 {G:Integer(1)}[G]
~/sage/local/lib/python3.7/site-packages/sage/misc/cachefunc.pyx in sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (build/cythonized/sage/misc/cachefunc.c:12907)()
2308 if self.cache is None:
2309 f = self.f
-> 2310 self.cache = f(self._instance)
2311 return self.cache
2312
~/sage/local/lib/python3.7/site-packages/sage/graphs/generic_graph.py in __hash__(self)
711 self._weighted,
712 frozenset(edge_items)))
--> 713 raise TypeError("This graph is mutable, and thus not hashable. "
714 "Create an immutable copy by `g.copy(immutable=True)`")
715
TypeError: This graph is mutable, and thus not hashable. Create an immutable copy by `g.copy(immutable=True)`
sage: sage: G_immutable = Graph(G, immutable=True)
....: sage: G_immutable == G
....:
True
sage: sage: {G_immutable:1}[G_immutable]
....:
1
sage: