# SageMathCell online https://sagecell.sagemath.org/?q=naufdu # (6,4) = 390; Moore bound= 937; # ''' Main properties of the graph rajiv441 | Ord.: 441 / Size: 1323 / Diam.: 4 / Avg.dist: 3.55974 / 6-reg.? True / Girth: 3 / Alg.conn. 1.83591 loz390 | Ord.: 390 / Size: 1170 / Diam.: 4 / Avg.dist: 3.44473 / 6-reg.? True / Girth: 6 / Alg.conn. 2.26352 Symmetry properties of the graph rajiv441 | Aut.group.ord.: 12096 / Cayley ? False --- vtx.trans. ? False -- edge.trans. ? False loz390 | Aut.group.ord.: 195 / Cayley ? False --- vtx.trans. ? False -- edge.trans. ? False Degree histogram rajiv441 : [0, 0, 0, 0, 0, 0, 441] Degree histogram loz390 : [0, 0, 0, 0, 0, 0, 390] Automorphism group structure C_n is the cyclic group of order n; x means direct product; : means semidirect product. rajiv441 : PSU(3,3) : C2 | center order: 1 loz390 : C5 x (C13 : C3) | center order: 5 rajiv441 distance distrib from vtx. 0: [1, 6, 30, 135, 269] loz390 distance distrib from vtx. 0: [1, 6, 30, 136, 217] Number of k-cycles for k=3 up to 6 rajiv441 63 | 189 | 0 | 1071 loz390 0 | 0 | 0 | 780 ''' import networkx as nx rajiv441 = Graph(r":~?Exb{C_bakKGkBYG?l_sLw\BUG?`b_MgM@AHon_OEG`BqHOx`cIgB@aJ_n`KHGY@y@odbCNgZ@}A?q_WHWmBiA_r_cHgFBID?sa[LgGAYA?r`WKGJAaA_gaGJwhAuB_pacMwiAmBoS_CLwjAy?_O_oKWRBMCO{_sDGgByD?x`GGgA?yDO|`KJGNBq??b`sKgOAI@Oc_wKwPAqC?x_sBwHBQCO|`oMgUBUDOt_gKGYBeE_zbWMGZB]F?b_K@GrB]FOc_OIggBa@O]`[MwUBe@_^`[LwaBuDOy`_GwhBQC_q`cHG@BUGo}a?HgD@iH?saCKGE@m?Ol_GGW]AY?___KNG^BAAon`kNWO@IF_}`_FG?@IFos`cFWD@MJ?l_W@wCBeF____AWiBu?on_cLgpBUA_J`cMGN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H{xcIaGWaDR}MA{NtLc~bCVrePdIHjIgureNp?hqHSfs\QEK?{DCfroh{oRTMuEpPRpOHTGghAyN|OIVI|OX[EooSJ`{KQMMmBRSQlJgLEGYcRRycq_MdHxRD[fckSiirnNH?sKSiUqkJ?pBN__ErqPTJWGB?yCz_gMBWPTITM_gYsYSYArXMPFdL`KUsTRDPHoFWmSyT]]qGLTFtW`KE`lP@QwsD[ccpSeG@BDX?SpiomC?RUN`AD{ZS{TUDqdI_wtZTuGomMxGsuTuE?yF\Gs}b[MaFPtShREgltATMGPPF?is}bWmr@NhXGNKSsCPTpXW`ECaqgLaFo`C?RCna{zrxQyNQRHWjaxUM\BhMpETfUeF_oGTGTHUeO`tG{odHgwbrNSTRd`bwRadN`WhAFogqzMybR{O@ITodT@CLRlYDpfokBQMpCwZFk^ASHyE_mGXIIQLcvBpNhZw_J|Fc_VL\X[EC]aFS\\X`HWoBUOESbTLXBDUUudbEM[~C`SqLpUI\LtKVQpbqO|GC{f[pRELgwtJ_o\aDKxSWkCo~dEVt^yoLo~sQQ|SycPDCcuTT]Z[OTFCjS\UgkBt@SbRdRwXKH@CDPdU^") rajiv441nx = rajiv441.networkx_graph() loz390nx =loz390.networkx_graph() # List of graphs to process graphs = [('rajiv441 ', rajiv441),('loz390 ', loz390)] def count_k_cycles(G, k): count = 0 visited = set() def dfs(path, start, depth): nonlocal count current = path[-1] # Early exit if we?re going too deep if depth == k: if start in G.neighbors(current): # Normalize to avoid duplicates cycle = tuple(sorted(path)) if cycle not in visited: visited.add(cycle) count += 1 return for neighbor in G.neighbors(current): if neighbor not in path and neighbor >= start: dfs(path + [neighbor], start, depth + 1) for v in G.vertices(): dfs([v], v, 1) return count # each cycle counted twice (once forward, once reverse) def algebraic_connectivity(G): """ Compute the algebraic connectivity (Fiedler value) of a graph G. INPUT: - G: a SageMath Graph OUTPUT: - The second-smallest eigenvalue of the Laplacian matrix of G """ L = G.laplacian_matrix() eigenvalues = L.eigenvalues() eigenvalues.sort() if len(eigenvalues) < 2: return 0 # Trivial case: empty or isolated vertex graph return eigenvalues[1] def check_all_isomorphisms(graph_list): n = len(graph_list) print("\n Isomorphism check of all pairs (a dot means the pair ARE isomorphic):") for i in range(n): label_i, G_i = graph_list[i] for j in range(i + 1, n): label_j, G_j = graph_list[j] if G_i.is_isomorphic(G_j): # print(".", end="") print(f"{label_i} IS isomorphic to {label_j}") else: print(f"{label_i} NOT isomorphic to {label_j}") def non_isomorphic(graph_list): reps = [] labels = [] for label, G in graph_list: if not any(G.is_isomorphic(H) for _, H in reps): reps.append((label, G)) labels.append(label.strip()) # remove extra spaces if you want return labels def isomorphic(graph_list): labels = [] for i, (label, G) in enumerate(graph_list): if any(i != j and G.is_isomorphic(H) for j, (_, H) in enumerate(graph_list)): labels.append(label.strip()) return labels def compare_graphs_list(graphs): canon = {} count =1 for label, G in graphs: s6 = G.canonical_label().sparse6_string() # print(f"{label.strip():15} : {s6[:40]}...") canon.setdefault(s6, []).append(label.strip()) print("\n noniso ->",len(canon)) print("\nGroups:") for group in canon.values(): if len(group) > 1: print(count,"Isomorphic :", ", ".join(group)) count=count+1 else: print(count,"Unique :", group[0]) count=count+1 print("\n START \n") #noniso = non_isomorphic(graphs) #print(len(noniso), " non-isomorphic -> ",noniso) #iso=isomorphic(graphs) #print(len(iso), " isomorphic -> ",iso,"\n") compare_graphs_list(graphs) nonisographs = graphs # Print properties for each graph in the list print("\n Main properties of the graph\n") for label, graph in nonisographs: print(f"{label} | Ord.: {graph.order()} / Size: {graph.size()} / Diam.: {graph.diameter()} / Avg.dist: {graph.average_distance().n(digits=6)} / 6-reg.? {graph.is_regular(k=6)} / Girth: {graph.girth()} / Alg.conn. {algebraic_connectivity(graph).n(digits=6)} ")# / Domin. number: {graph.dominating_set(value_only=True)} ") print("\n Symmetry properties of the graph\n") for label, graph in nonisographs: print(f"{label} | Aut.group.ord.: {graph.automorphism_group().order()} / Cayley ? {graph.is_cayley()} --- vtx.trans. ? {graph.is_vertex_transitive()} -- edge.trans. ? {graph.is_edge_transitive()}" ) print("Degree histogram rajiv441 :", nx.degree_histogram(rajiv441nx) ) print("Degree histogram loz390 :", nx.degree_histogram(loz390nx) ) ''' print("\n Properties of the graphs as at arXiv\n") for label, graph in nonisographs: print(f"{label} & {graph.average_distance().n(digits=6)} & {graph.girth()} & {algebraic_connectivity(graph).n(digits=6)} & {graph.automorphism_group().order()} \\\\ ") ''' # Check isomorphisms # print(f"Are isomorphic G5 and G6? {G5.is_isomorphic(G6)}") #check_all_isomorphisms(nonisographs) print("\n") # automorphism group structure print(" Automorphism group structure") print(' C_n is the cyclic group of order n; x means direct product; : means semidirect product.\n') Arajiv441 = rajiv441.automorphism_group() Aloz390 = loz390.automorphism_group() print('rajiv441 :', Arajiv441.structure_description(), ' | center order:',Arajiv441.center().order()) print('loz390 :', Aloz390.structure_description(), ' | center order:',Aloz390.center().order()) print("\n") # Compute the distance distribution from a given vertex v in graph G # Returns a list where the i-th element is the number of vertices at distance i from v def distance_distribution(G, v): from collections import Counter distances = G.shortest_path_lengths(v) distribution = Counter(distances.values()) result = [distribution[d] for d in sorted(distribution)] return result print("\n") for label, graph in nonisographs: print(f"{label} distance distrib from vtx. 0: {distance_distribution(graph, 0)}") # Counting k-cycles for each graph print("\nNumber of k-cycles for k=3 up to 6") for label, graph in nonisographs: print(f"{label} "," | ".join(str(count_k_cycles(graph, k)) for k in range(3, 7))) ''' # from 0 versio Molodtsov? for name, G in nonisographs: fname = name.strip() + "_adjlst.txt" s = "; ".join( "{}-{}".format(v, ",".join(map(str, G.neighbors(v)))) if G.neighbors(v) else str(v) for v in G.vertices(sort=True) ) with open(fname, "w") as f: f.write(s) ''' # from 0 for label, _ in nonisographs: base = label.strip() G = globals()[base + "nx"] with open(f"{base}_edges.txt", "w") as f: f.write(",".join( f"{{{u},{v}}}" for u, v in sorted((min(u, v), max(u, v)) for u, v in G.edges()) )) ''' # from 1 for label, _ in nonisographs: base = label.strip() G = globals()[base + "nx"] with open(f"{base}_Zedges.txt", "w") as f: f.write(",".join( f"{{{u+1},{v+1}}}" for u, v in sorted((min(u, v), max(u, v)) for u, v in G.edges()) )) ''' print("\n DONE \n") ## ##