The genetic algorithm code can be modified slightly to always start at a specific point and also not return to that point; you just mark it as already having all it's connections. So the amount of connections would be one less than a closed-loop.