In this paper, we study the k-labeled spanning forest (kLSF) problem in which an undirected graph whose edges are labeled and an integer-positive value k are given; the aim is to find a spanning forest of the input graph with the minimum number of connected components and the upper bound k on the number of labels. The problem is related to the minimum labeling spanning tree problem and has several applications in the real world. In this paper, we compare several metaheuristics to solve this NP-hard problem. In particular, the proposed intelligent variable neighborhood search (VNS) shows excellent performance, obtaining high-quality solutions in short computational running time. This approach integrates VNS with other complementary approaches from machine learning, statistics, and experimental algorithmics, in order to produce high-quality performance and completely automate the resulting optimization strategy.