For graph G(p,q), if there exists an injective function f:V(G)→[0,1,2,…,q], such that f(E(G))={f(uv)=(f(u)+f(v))mod (q+1)|uv∈E(G)}=[1,…,q], the graph G is called an elegant graph. A combination of pruning and predictive function is used to design a recursive backtracking algorithm. The elegance of all the simple connected graphs in 9 points is verified, and all elegant and non-elegant graphs are obtained. According to the experimental results, it is verified that when 3≤p≤9, all tree graphs and unicyclic graphs are almost elegant, which proves that when 3≤q≤9 and q≠1(mod 4), the graph G(p,q)is elegant. Finally, the conjecture that the majority of the graphs are elegant is given. |