added support for defining number of connections between nodes