  A set of natural numbers is primitive if no element of the set divides
another. Erd\H{o}s conjectured that if S is any primitive set, then \sum_{n\in
S} 1/(n log n) \le \sum_{n\in \P} 1/(p log p), where \P denotes the set of
primes. In this paper, we make progress towards this conjecture by restricting
the setting to smaller sets of primes. Let P denote any subset of \P, and let
N(P) denote the set of natural numbers all of whose prime factors are in P. We
say that P is Erd\H{o}s-best among primitive subsets of N(P) if the inequality
\sum_{n\in S} 1/(n log n) \le \sum_{n\in P} 1/(p log p) holds for every
primitive set S contained in N(P). We show that if the sum of the reciprocals
of the elements of P is small enough, then P is Erd\H{o}s-best among primitive
subsets of N(P). As an application, we prove that the set of twin primes
exceeding 3 is Erd\H{o}s-best among the corresponding primitive sets. This
problem turns out to be related to a similar problem involving multiplicative
weights. For any real number t>1, we say that P is t-best among primitive
subsets of N(P) if the inequality \sum_{n\in S} n^{-t} \le \sum_{n\in P} p^{-t}
holds for every primitive set S contained in N(P). We show that if the sum on
the right-hand side of this inequality is small enough, then P is t-best among
primitive subsets of N(P).
