We use quantum graphs as a model to study various mathematical aspects of the vacuum energy, such as convergence of periodic path expansions, consistency among different methods (trace formulae versus method of images) and the possible connection with the underlying classical dynamics. We derive an expansion for the vacuum energy in terms of periodic paths on the graph and prove its convergence and smooth dependence on the bond lengths of the graph. For an important special case of graphs with equal bond lengths, we derive a simpler explicit formula. The main results are derived using the trace formula. We also discuss an alternative approach using the method of images and prove that the results are consistent. This may have important consequences for other systems, since the method of images, unlike the trace formula, includes a sum over special ``bounce paths. We succeed in showing that in our model bounce paths do not contribute to the vacuum energy. Finally, we discuss the proposed possible link between the magnitude of the vacuum energy and the type (chaotic vs. integrable) of the underlying classical dynamics. Within a random matrix model we calculate the variance of the vacuum energy over several ensembles and find evidence that the level repulsion leads to suppression of the vacuum energy.