Environmental dependence of X-ray and optical properties of galaxy clusters