}
//Break recursion if we end up on a routing pipe, unless its the first one. Will break if matches the first call
if (startPipe.isRoutingPipe() && setVisited.size() != 0) {
CoreRoutedPipe rp = startPipe.getRoutingPipe();
if(rp.stillNeedReplace()) {
return foundPipes;
}
int size = 0;
for(Integer dis:distances.values()) {
size += dis;