Filter Optimization in SDN-based Flexgrid Networks