Construction of cycles in a graph is investigated, where cycles from particular subsets (such as bases) are added together so that each partial sum is also a cycle or each new cycle intersects the sum of the preceding terms in a nontrivial path. Starting with the geodesic cycles, a hierarchical construction is given. For the hypercube graph, geodesic cycles are characterized, and it is shown how hypercube geodesic cycles can be constructed in two steps from a special basis. Applications are given to inferring commutativity of a diagram in a groupoid from commutativity of some of its cycles.