This study conducts a detailed numerical investigation on the spatial distribution of solid obstacles using the large eddy simulation method. It is discovered that although flame acceleration induced by solid obstacles is dominated by factors such as flow field disturbances, vortices and recirculation zones, turbulence, flame surface areas and combustion heat release rates, etc., the characteristics of the leading shock wave are key to detonation initiation. Specifically, the intensity of the leading shock wave, its formation time, and its distance from the flame front significantly affect detonation initiation. Depending on the state of the shock wave, the detonation initiation process may occur through various mechanisms such as shock reflection, shock focusing. Overall, the types of detonation initiation in this study all belong to the shock detonation transition. However, the detonation initiation process can be further classified into two categories: (I) Detonation induced by shock wave reflection; (II) detonation triggered by shock wave focusing. Despite certain disparities in the detonation initiation process, all detonation initiation processes conform to the gradient theory, and the flame evolution processes in all cases consistently follow three stages: the laminar slow-ignition stage; the turbulent deflagration stage; the detonation initiation stage. Furthermore, the study further discerns that, compared to positioning obstacles on the wall, placing obstacles inside the combustion chamber can further augment the detonation-assisting effect. However, excessively sparse or dense spatial distributions of solid obstacles fail to yield the optimal detonation effect. An optimal distribution exists, which triggers the fastest detonation initiation.