This paper deals with the efficient design of network switch/routers for an optical data center network. Each switch has multiple components such as ingress/egress interfaces, optical and/or electronic buffers, interconnection switching fabric and so on. There are several possible choices available for each of these components. This paper presents a systematic approach to designing the switch architecture using a combination of these component choices, while meeting specified design criteria. It requires formally defining the structure of a switch and enforcing semantics across components. This is formulated as a constraint optimization problem with formal language grammar guiding its search process. This problem formulation is used to identify the best-possible architecture for a hierarchical DCN. Two of the three solutions identified were new and were not reported in literature. These solutions were also validated experimentally. © 2017 IEEE.