An Efficient Algorithm for Cost effective Mechanism in WDM Network