The task of the quartet puzzling problem is to find a best-fitting binary X-tree for a finite n-set from confidence values for the 3 n 4 binary trees with exactly four leaves from X, its fitness being measured by the sum of the confidence values of all "induced" four-leaves subtrees. We describe a method for finding an exact solution of this problem by integer linear programming. Similar procedures can also be used for finding, e.g., best-fitting "circular" networks. A crucial problem in this context is, of course, how to obtain the input confidence values for the quartet trees. We propose to use inner products of rate-matrix diagonals calculated for pairs of taxa and present the trees resulting from applying our approach to two data sets of up to 36 mitochondrial sequences of mammals including an outgroup. Key words: weighted quartet, integer linear programming, observed rate matrix, Mammals' mitochondrial evolution, phylogeny This paper is based on ideas tha...