  We study the statistical properties of the scattering matrix associated with
generic quantum graphs. The scattering matrix is the quantum analogue of the
classical evolution operator on the graph. For the energy-averaged spectral
form factor of the scattering matrix we have recently derived an exact
combinatorial expression. It is based on a sum over families of periodic orbits
which so far could only be performed in special graphs. Here we present a
simple algorithm implementing this summation for any graph. Our results are in
excellent agreement with direct numerical simulations for various graphs.
Moreover we extend our previous notion of an ensemble of graphs by considering
ensemble averages over random boundary conditions imposed at the vertices. We
show numerically that the corresponding form factor follows the predictions of
random-matrix theory when the number of vertices is large---even when all bond
lengths are degenerate. The corresponding combinatorial sum has a structure
similar to the one obtained previously by performing an energy average under
the assumption of incommensurate bond lengths.
