  We introduce a new measure of complexity (called spectral complexity) for
directed graphs. We start with splitting of the directed graph into its
recurrent and non-recurrent parts. We define the spectral complexity metric in
terms of the spectrum of the recurrence matrix (associated with the reccurent
part of the graph) and the Wasserstein distance. We show that the total
complexity of the graph can then be defined in terms of the spectral
complexity, complexities of individual components and edge weights. The
essential property of the spectral complexity metric is that it accounts for
directed cycles in the graph. In engineered and software systems, such cycles
give rise to sub-system interdependencies and increase risk for unintended
consequences through positive feedback loops, instabilities, and infinite
execution loops in software. In addition, we present a structural decomposition
technique that identifies such cycles using a spectral technique. We show that
this decomposition complements the well-known spectral decomposition analysis
based on the Fiedler vector. We provide several examples of computation of
spectral and total complexities, including the demonstration that the
complexity increases monotonically with the average degree of a random graph.
We also provide an example of spectral complexity computation for the
architecture of a realistic fixed wing aircraft system.
