Don't know the optimal strategy, but you can assume a simple procedure. You test N people together. If test is positive, you test each one separately. So you make at most N+1 tests and 1 if you are lucky enough to get a negative pool result.
Say that p is the fraction of people with the desease and N is the pool size. Following the above strategy, your expected number of test is:
E[N | p] = (1-p)^N + (N+1)*(1-(1-p)^N)
(1-p)^N is the probability that no one in the pool is positive; in that case you need just one test. In the other cases, you need N+1 tests (this is a little overestimate. In fact, if there is just one positive and you test everyone before them, you don't it to test them). Obviously, if you perform tests to anybody in the pool you need N tests.
The gap between the number of tests of this strategy and testing everyone is:
f(N) = (1-p)^N + (N+1)*(1-(1-p)^N) - N
You can just minimize the above function to get the optimal size N. It turns out that the result goes like ~ 1/p.
In the R code just to have a picture.
Code:
f<-function(N,p) {
p0<-(1-p)^N
p0+(1-p0)*(N+1)-N
}
bestN<-function(p) {
res<-t(vapply(p, function(x) unlist(optimize(f,interval=c(0,2/x),p=x)),numeric(2)))
res[,2]<-abs(res[,2])/res[,1]
res
}
p<-seq(0.001,0.3,by=0.001)
optN<-bestN(p)
plot(p,optN[,1],ty="l",lwd=2,col="red")