In constraint programming, you consider a collection of decisions, each with a number of alternatives.  If a (routed-)demand fails, a mesh restoration system must decide which path to choose to restore the demand.  A path considered for use in rerouting a failed demand is called an altpath.  

 

For (static) dedicated protection systems, there is one altpath for each 1+1 demand.  The standard algorithm for finding the shortest pair of disjoint paths (working length + altpath length) is Suurballe's algorithm

 

In mesh restoration systems, each restorable path is associated with one or more possible altpaths to use if the restorable path is disrupted.  Different altpaths may be used to recover different types of failures, so in some restoration systems fault isolation needs to be done before an altpath can be chosen as the new path for the demand.  

 

In some fast restoration systems, as such MPLS Fast Reroute (FRR), one altpath is calculated for each link failure of a (directional) LSP. While this restoration system is fast and the altpath can be calculated using the shortest path algorithms built into MPLS routers, the FRR choice of the altpath is often suboptimal.  For more efficient restoration systems, many altpaths need to be considered and then selected in a globally-optimal manner.

 

So we need many altpaths for each restorable path.  How are these generated?  The most common method is k-shortest-paths.  Here is a link to this algorithm implemented in the open source Net2Plan system. 

 

A cautionary tale:  more altpaths do not necessarily lead to better designs.  In some algorithms, more altpaths may only slow convergence to a good design.  In others, too many altpaths may lead to worse designs or designs that are overly-sensitive to minor changes in demands.  Choosing the right set of altpaths is one of the key strategies in any good mesh restoration system.