import racg_algorithms as r
We create three graphs. The "square" graph is a 4-cycle. The "pentagon_amalg_square" graph is a 5-cycle glued to a 4-cycle along one vertex. While, "G" corresponds to a thick RACG.
square = r.Graph(4)
square.set_edges([(0,2),(0,3),(1,2),(1,3)])
pentagon_amalg_square = r.Graph(8)
pentagon_amalg_square.set_edges([(0,1),(1,2),(2,3),(3,4),(4,0),(0,5),(0,6),(6,7),(5,7)])
G = r.Graph(9)
G.set_edges([(0,2),(0,3),(0,8),(0,4),(1,2),(1,3),(1,8),(1,4),(2,5),(3,5),(4,6),(4,7),(5,6),(5,7),(6,7)])
Edges of a graph object are encoded by an adjacency list.
G.edges
The group_summary function summarizes what can be computed regarding the divergence, thickness and hypergraph index of the RACG associated to a graph.
r.group_summary(square)
r.group_summary(pentagon_amalg_square)
r.group_summary(G)
We get further information on the group's divergence by finding the rank n pairs. get_rank_n_pairsreturns a list of lists, ranked_n_pairs. The pairs of vertices in ranked_pairs[i] are the rank i pairs. ranked_pairs[0] is the set of all pairs of non-adjacent vertices
rank_n_pairs = r.get_rank_n_pairs(G)
len(rank_n_pairs)
From below, we know that the bi-infinite geodesic, ...060606... in the RACG corresponding to G has at least cubic divergence (actually by above we know the divergence is exactly cubic).
rank_n_pairs[2]
We may also just compute the hypergraph index:
r.get_hyp_index(G)