R code of a guifinet topology generator