# Routing Algorithms

**URL:** <https://forum.mergetb.net/t/routing-algorithms/57>\
**Category:** Networks\
**Created:** [July 21, 2020, 3:02pm UTC](https://forum.mergetb.net/t/routing-algorithms/57 "2020-07-21T15:02:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ry](https://forum.mergetb.net/user_avatar/forum.mergetb.net/ry/32/64_2.png) [@ry](https://forum.mergetb.net/u/ry)\
**Post date:** [July 21, 2020, 3:02pm UTC](https://forum.mergetb.net/t/routing-algorithms/57/1 "2020-07-21T15:02:16Z")

</div>

This is a collection of notes I’m taking on the implementation of routing algorithms in Merge.

# Multipath Network Properties

## Path counting

The number of distinct paths between any 2 given points on a network, assuming the network is fully connected is the following

dest \mapsto \prod\_{n}^{nodes} routes(n, dest)

the product of the number of routes to the destination at each node in the network. In a non-multipath network this simply decays to 1 as the path to any particulat destination is unique and each node only has a single route. It’s important to note that the routes function must take into account the shortest route to avoid loops. Consider the diagram below

 ![image](https://forum.mergetb.net/uploads/default/original/1X/137a14b5f49af3419b2cdadef25928624a0c6815.png)

When considering routes to node 11 at `f3`, clearly one could go through `s1` and through `f2` instead of directly to `l4` or `l3` however this does not represent the best path. Alternatively chosing `l3` or `l4` has an equal cost, so both paths are viable.
