The data that you have defines a Directed Graph (DG). A more traditional representation would be an Adjacency List:
A -> { B }
B -> { C, E }
C -> { E }
D -> { G }
E -> { D }
F -> { E }
G -> { }
You can find cycles in DGs by running a Depth-First Search (DFS) algorithm on them. A cycle exists if, and only if, there is a back edge. You can retrieve the cycle easier if your recursive implementation of DFS passes down the list of vertexes visited on the path from the initial node to the current one. Once your algorithm detects a back edge, it traverses the current path from the source, finds the destination vertex of the back edge, and takes the edges from that vertex to the end as the part of a cycle.
You can find good implementations of DFS among answers to this question.