The construction of suitable mesh configurations for spline models that provide local refinement capabilities is one of the fundamental components for the analysis and development of adaptive isogeometric methods. We investigate the design and implementation of refinement algorithms for hierarchical B-spline spaces that enable the construction of locally graded meshes. The refinement rules properly control the interaction of basis functions at different refinement levels. This guarantees a bounded number of nonvanishing (truncated) hierarchical B-splines on any mesh element. The performances of the algorithms are validated with standard benchmark problems.