We propose a novel network screening method for hotspot (i.e., sites that suffer from high collision concentration and have high potential for safety improvement) identification based on the optimization framework to maximize the total summation of a selected safety measure for all hotspots considering a resource constraint for conducting detailed engineering studies (DES). The proposed method allows the length of each hotspot to be determined dynamically based on constraints the users impose. The calculation of the Dynamic Site Length (DSL) method is based on Dynamic Programming, and it is shown to be effective to find the close-to-optimal solution with computationally feasible complexity. The screening method has been demonstrated using historical crash data from extended freeway routes in San Francisco, California. Using the Empirical Bayesian (EB) estimate as a safety measure, we compare the performance of the proposed DSL method with other conventional screening methods, Sliding Window (SW) and Continuous Risk Profile (CRP), in terms of their optimal objective value (i.e., performance of detecting sites under the highest risk). Moreover, their spatio-temporal consistency is compared through the site and method consistency tests. Findings show that DSL can outperform SW and CRP in investigating more hotspots under the same amount of resources allocated to DES by pinpointing hotspot locations with greater accuracy and showing improved spatio-temporal consistency.