In this paper, we study the minimum spanning tree problem for vertex-labeled graphs, where the weights of edges may vary depending on the selection of labels of vertices at both ends. The problem is especially important as the application to mathematical OCR. It is shown that the problem is NP-hard even on directed acyclic graphs (DAGs). However, there exists a linear-time algorithm for graphs of small tree-width. The relation to the generalized minimum spanning tree problem is discussed.