In this paper, a new genetic algorithm with self-configuration chromosomes for optimization is proposed. In legacy approaches, the chromosomes are with a constant structure. Thus, the search driven by genetic algorithm in solution space is not efficient. In this paper, a scheme of configuring chromosome structure is presented. The chromosome structure is adjusted according to the solution space. The proposed scheme is composed of three phases; solution space analysis, chromosome configuration and genetic operation. Through three phases, the chromosome structure is derived from solution space analysis and is adjusted in iterations to approach the optimal solution. The proposed scheme is applied to find the shortest secure path for people in blaze scene. We deploy a wireless sensor network to collect the temperature distribution in a blaze scene. The proposed genetic algorithm will discover the fleeing path from the measured temperature distribution. The experimental results show that the proposed scheme features (1) effectiveness (2) timeliness and (3) reliability. The developed system also benefits the security and safety of people in business buildings.