  This paper presents an algorithm for an automatic transformation (=routing)
of time ordered topologies of Goldstone diagrams (i.e. Wick contractions) into
graphical representations of these topologies. Since there is no hard criterion
for an optimal routing, the proposed algorithm minimizes an empirically chosen
cost function over a set of parameters. Some of the latter are naturally of
discrete type (e.g. interchange of particle/hole lines due to antisymmetry)
while others (e.g. x,y-position of nodes) are naturally continuous. In order to
arrive at a manageable optimization problem the position space is artificially
discretized. In terms of the (i) cost function, (ii) the discrete vertex
placement, (iii) the interchange of particle/hole lines the routing problem is
now well defined and fully discrete. However, it shows an exponential
complexity with the number of vertices suggesting to apply a genetic algorithm
for its solution. The presented algorithm is capable of routing non trivial
(several loops and crossings) Goldstone diagrams. The resulting diagrams are
qualitatively fully equivalent to manually routed ones. The proposed algorithm
is successfully applied to several Coupled Cluster approaches and a
perturbative (fixpoint iterative) CCSD expansion with repeated diagram
substitution.
