We propose a novel method, the Geographical Dynamic Scan (GDScan) to find optimal connected clusters. It employs an adaptation of the NemhauserÁUllman algorithm for the 0Á1 knapsack problem (4). We minimize a biobjective vector function F(z)0((C(z),N(z)), where C(z) and N(z) are the number of cases and the population of the candidate cluster z, respectively. Then, we show that the solution which maximizes the spatial scan statistic is included in the set of nondominated solutions of F (the Pareto set), showing that the dynamic programming algorithm allows to solve the unconstrained maximization of the scan statistic for any given spatial dataset. However, this is typically not sufficient to solve practical spatial detection problems.