The document proposes algorithms to more efficiently encode Segment Routing paths in MPLS networks to address the limitation of maximum stack depth (MSD). It introduces the problem that strictly encoding paths as a label stack can result in some paths being unusable if they exceed the MSD. It then presents the Segment Routing Paths Label Encoding Algorithm (SR-LEA) which can encode paths using fewer labels by mapping multiple hops to a single label when possible. Simulation results show SR-LEA increases the percentage of usable paths. The document concludes the algorithms help mitigate the impact of the MSD limitation and enable wider deployment of Segment Routing.