  We demonstrate theoretically that hydrogenation and annealing applied to
nanoscale carbon structures play a crucial role in determining the final shape
of the system. In particular, graphene flakes characterized by the linear and
non-hydrogenated zigzag or armchair edges have high propensity to merge into a
bigger flake or a nanotube (the formation of a single carbon-carbon bond lowers
the total energy of the system by up to 6.22 eV). Conversely, the line of the
$sp^2$ carbon bonds (common for pure carbon structures such as graphene or a
carbon nanotube) converted into the $sp^3$ type by hydrogenation shows an
ability to disassemble the original structure by cutting it along the line of
the modified bonds. These structural transformations provide us with an
understanding of the behavior of mobile carbon structures in solution and a
distinct scenario of how to preserve the original structure which would be a
crucial issue for their application in carbon-based electronics.
