  Designing thermoelectric materials with high figure of merit $ZT=S^2 G
T/\kappa$ requires fulfilling three often irreconcilable conditions, i.e., the
high electrical conductance $G$, small thermal conductance $\kappa$ and high
Seebeck coefficient $S$. Nanostructuring is one of the promising ways to
achieve this goal as it can substantially suppress lattice contribution to
$\kappa$. However, it may also unfavorably influence the electronic transport
in an uncontrollable way. Here we theoretically demonstrate that this issue can
be ideally solved by fabricating graphene nanoribbons with heavy adatoms and
nanopores. These systems, acting as a two-dimensional topological insulator
with robust helical edge states carrying electrical current, yield a highly
optimized power factor $S^2G$ per helical conducting channel. Concurrently,
their array of nanopores impedes the lattice thermal conduction through the
bulk. Using quantum transport simulations coupled with first-principles
electronic and phononic band structure calculations, the thermoelectric figure
of merit is found to reach its maximum $ZT \simeq 3$ at $T \simeq 40$ K. This
paves a way to design high-$ZT$ materials by exploiting the nontrivial topology
of electronic states through nanostructuring.
