addedd method for topology creation and neighbhor calculation