this paper describes an approach to discover the functional structure of a typical commercial building with swarm intelligence. we use a swarm algorithm to analyze a typical logfile and group all sensors and e¿ectors in a building into several clusters.