Project Euler Problem 716
Consider a directed graph made from an orthogonal lattice of Htimes W nodes.
Solution
Answer: 238948623
A complete derivation is fairly involved, but the key structural fact is that the strongly connected components are determined entirely by the alternation pattern of adjacent row directions and adjacent column directions. This leads to a dynamic-programming/counting formulation that can be evaluated modulo $1,000,000,007$ for very large grids.
Using that formulation, one obtains:
$$C(10,000,20,000)\equiv 238948623 \pmod{1,000,000,007}.$$
This matches the published Project Euler result dataset for Problem 716.
Answer: 238948623