We study by numerical simulation the compaction dynamics of frictional hard disks in two dimensions, subjected to vertical shaking. Shaking is modeled by a series of vertical expansions of the disk packing, followed by dynamical recompression of the assembly under the action of gravity. The second phase of the shake cycle is based on an efficient event−driven molecular−dynamics algorithm. We analyze the compaction dynamics for various values of friction coefficient and coefficient of normal restitution. We find that the time evolution of the density is described by ρ(t)=ρ∞ − ρEα[−(t/τ)α], where Eα denotes the Mittag−Leffler function of order 0<α<1. The parameter τ is found to decay with tapping intensity Γ according to a power law τ ∝ Γ−γ , where parameter γ is almost independent of the material properties of grains. Also, an expression for the grain mobility during compaction process has been obtained.