This work presents a novel method for BN structure learning with bounded tree-width. The algorithm is based on a fast bijection between k-trees and the Dandelion codes. The Distance Preferable Sampling is designed to effectively cover the space of k-trees. The probabilistic hill climbing algorithm is used to obtain k-trees of high quality. Extensive experiments indicate the efficiency and effectiveness of the proposed algorithm.