Achieve Optimal Routing and Reduce BGP Memory Consumption