Given a multigraph G = (V, E) with a positive rational weight w(e) on each edge e, the weighted density problem (WDP) is to find a subset U of V , with |U | ≥ 3 and odd, that maximizes 2w(U) |U |−1 , where w(U) is the total weight of all edges with both ends in U , and the weighted fractional edge-coloring problem can be formulated as the linear program Minimize 1 T x subject to Ax = w x ≥ 0, where A is the edge-matching incidence matrix of G. These two problems are closely related to the celebrated Goldberg-Seymour conjecture on edge-colorings of multigraphs, and are interesting in their own right. Even when w(e) = 1 for all edges e, determining whether WDP can be solved in polynomial time was posed by Jensen and Toft [9] and by Stiebitz et al. [22] as an open problem. In this paper we present strongly polynomial-time algorithms for solving them exactly, and develop a novel matching removal technique for multigraph edge-coloring.