  We investigate the physical implementation of Shor's factorization algorithm
on a Josephson charge qubit register. While we pursue a universal method to
factor a composite integer of any size, the scheme is demonstrated for the
number 21. We consider both the physical and algorithmic requirements for an
optimal implementation when only a small number of qubits is available. These
aspects of quantum computation are usually the topics of separate research
communities; we present a unifying discussion of both of these fundamental
features bridging Shor's algorithm to its physical realization using Josephson
junction qubits. In order to meet the stringent requirements set by a short
decoherence time, we accelerate the algorithm by decomposing the quantum
circuit into tailored two- and three-qubit gates and we find their physical
realizations through numerical optimization.
