@@ -73,7 +73,7 @@ def degseq_to_data(degree_sequence):
73
73
3221
74
74
"""
75
75
degree_sequence .sort ()
76
- return sum (degree_sequence [ i ] * 10 ** i for i in range ( len ( degree_sequence ) ))
76
+ return sum (di * 10 ** i for i , di in enumerate ( degree_sequence ))
77
77
78
78
79
79
def data_to_degseq (data , graph6 = None ):
@@ -101,9 +101,8 @@ def data_to_degseq(data, graph6=None):
101
101
if not degseq :
102
102
# compute number of 0's in list from graph6 string
103
103
from sage .graphs .generic_graph_pyx import length_and_string_from_graph6
104
- return length_and_string_from_graph6 (str (graph6 ))[0 ]* [0 ]
105
- else :
106
- return degseq
104
+ return length_and_string_from_graph6 (str (graph6 ))[0 ] * [0 ]
105
+ return degseq
107
106
108
107
109
108
def graph6_to_plot (graph6 ):
@@ -181,43 +180,43 @@ def subgraphs_to_query(subgraphs, db):
181
180
# tables columns input data type sqlite data type
182
181
# -----------------------------------------------------------------------------
183
182
aut_grp = ['aut_grp_size' , # Integer INTEGER
184
- 'num_orbits' , # Integer INTEGER
185
- 'num_fixed_points' , # Integer INTEGER
186
- 'vertex_transitive' , # bool BOOLEAN
187
- 'edge_transitive' ] # bool BOOLEAN
183
+ 'num_orbits' , # Integer INTEGER
184
+ 'num_fixed_points' , # Integer INTEGER
185
+ 'vertex_transitive' , # bool BOOLEAN
186
+ 'edge_transitive' ] # bool BOOLEAN
188
187
degrees = ['degree_sequence' , # list INTEGER (see degseq_to_data module function)
189
- 'min_degree' , # Integer INTEGER
190
- 'max_degree' , # Integer INTEGER
191
- 'average_degree' , # Real REAL
192
- 'degrees_sd' , # Real REAL
193
- 'regular' ] # bool BOOLEAN
188
+ 'min_degree' , # Integer INTEGER
189
+ 'max_degree' , # Integer INTEGER
190
+ 'average_degree' , # Real REAL
191
+ 'degrees_sd' , # Real REAL
192
+ 'regular' ] # bool BOOLEAN
194
193
misc = ['vertex_connectivity' , # Integer INTEGER
195
- 'edge_connectivity' , # Integer INTEGER
196
- 'num_components' , # Integer INTEGER
197
- 'girth' , # Integer INTEGER
198
- 'radius' , # Integer INTEGER
199
- 'diameter' , # Integer INTEGER
200
- 'clique_number' , # Integer INTEGER
201
- 'independence_number' , # Integer INTEGER
202
- 'num_cut_vertices' , # Integer INTEGER
203
- 'min_vertex_cover_size' , # Integer INTEGER
204
- 'num_spanning_trees' , # Integer INTEGER
205
- 'induced_subgraphs' ] # String STRING
194
+ 'edge_connectivity' , # Integer INTEGER
195
+ 'num_components' , # Integer INTEGER
196
+ 'girth' , # Integer INTEGER
197
+ 'radius' , # Integer INTEGER
198
+ 'diameter' , # Integer INTEGER
199
+ 'clique_number' , # Integer INTEGER
200
+ 'independence_number' , # Integer INTEGER
201
+ 'num_cut_vertices' , # Integer INTEGER
202
+ 'min_vertex_cover_size' , # Integer INTEGER
203
+ 'num_spanning_trees' , # Integer INTEGER
204
+ 'induced_subgraphs' ] # String STRING
206
205
spectrum = ['spectrum' , # String STRING
207
206
'min_eigenvalue' , # Real REAL
208
207
'max_eigenvalue' , # Real REAL
209
208
'eigenvalues_sd' , # Real REAL
210
209
'energy' ] # Real REAL
211
- graph_data = ['complement_graph6' , # String STRING
212
- 'eulerian' , # bool BOOLEAN
213
- 'graph6' , # String STRING
214
- 'lovasz_number' , # Real REAL
215
- 'num_cycles' , # Integer INTEGER
216
- 'num_edges' , # Integer INTEGER
217
- 'num_hamiltonian_cycles' , # Integer INTEGER
218
- 'num_vertices' , # Integer INTEGER
219
- 'perfect' , # bool BOOLEAN
220
- 'planar' ] # bool BOOLEAN
210
+ graph_data = ['complement_graph6' , # String STRING
211
+ 'eulerian' , # bool BOOLEAN
212
+ 'graph6' , # String STRING
213
+ 'lovasz_number' , # Real REAL
214
+ 'num_cycles' , # Integer INTEGER
215
+ 'num_edges' , # Integer INTEGER
216
+ 'num_hamiltonian_cycles' , # Integer INTEGER
217
+ 'num_vertices' , # Integer INTEGER
218
+ 'perfect' , # bool BOOLEAN
219
+ 'planar' ] # bool BOOLEAN
221
220
222
221
valid_kwds = aut_grp + degrees + misc + spectrum + graph_data
223
222
0 commit comments