A method executed by a network device to calculate loop free alternative, LFA, paths for nodes in an intermediate system - intermediate system, IS-IS, area or IS-IS domain where the network device is connected with other nodes via multiple parallel links, where shortest path first, SPF, of the primary paths for the network device tracks directly connected links from each node in the IS-IS area or IS-IS domain to the network device which is a source node for the SPF, the method comprising the steps of: adding the source node to a candidate list with a cost of zero; selecting a least-cost candidate node from the candidate list; and processing the selected candidate node; wherein processing the selected candidate node comprises: selecting a next link of the selected candidate node; and processing the selected link; wherein processing the selected link comprises: checking whether the selected candidate node is the source node; saving the selected link as a non-equal cost multi-path, ECMP, directly connected link for a node connected to other end of the selected link, where the selected candidate node is the source node; checking whether the node connected to the other end of the selected link is in a shortest path tree constructed by a SPF computation that is a representation of the topology of the network; checking whether the node at the other end of the selected link is in the candidate list; adding the node connected to the other end of the selected link to the candidate list, where the node connected to the other end of the selected link is not in the candidate list; otherwise checking whether a cost of the selected candidate node plus a cost of the selected link is less than the cost of the node at the other end of the selected link; updating the cost of the node at the other end of the selected link to the cost of the selected candidate plus the cost of the selected link, where the cost of the selected candidate node plus the cost of the selected link is less than the cost of the node at the end of the selected link; setting the selected link as next hop of the node at the other end of the selected link, where the selected candidate node is the source node; inheriting a selected candidate next hop to the node at the other end of the selected link, where the selected candidate node is not the source node; if additional links of the selected candidate node remain to be processed, selecting an additional next link of the selected candidate node, and processing the selected additional next link; moving the selected candidate node to the shortest path tree, where all links of the selected candidate node have been processed; and if additional candidate nodes remain to be processed, selecting an additional least-cost candidate node from the additional candidate nodes, and processing the selected additional least-cost candidate node. adding the source node to a candidate list with a cost of zero; selecting a least-cost candidate node from the candidate list; and processing the selected candidate node; selecting a next link of the selected candidate node; and processing the selected link; checking whether the selected candidate node is the source node; saving the selected link as a non-equal cost multi-path, ECMP, directly connected link for a node connected to other end of the selected link, where the selected candidate node is the source node; checking whether the node connected to the other end of the selected link is in a shortest path tree constructed by a SPF computation that is a representation of the topology of the network; checking whether the node at the other end of the selected link is in the candidate list; adding the node connected to the other end of the selected link to the candidate list, where the node connected to the other end of the selected link is not in the candidate list; otherwise checking whether a cost of the selected candidate node plus a cost of the selected link is less than the cost of the node at the other end of the selected link; updating the cost of the node at the other end of the selected link to the cost of the selected candidate plus the cost of the selected link, where the cost of the selected candidate node plus the cost of the selected link is less than the cost of the node at the end of the selected link; setting the selected link as next hop of the node at the other end of the selected link, where the selected candidate node is the source node; inheriting a selected candidate next hop to the node at the other end of the selected link, where the selected candidate node is not the source node; if additional links of the selected candidate node remain to be processed, selecting an additional next link of the selected candidate node, and processing the selected additional next link; moving the selected candidate node to the shortest path tree, where all links of the selected candidate node have been processed; and if additional candidate nodes remain to be processed, selecting an additional least-cost candidate node from the additional candidate nodes, and processing the selected additional least-cost candidate node.