Tobias Fritz [posted a puzzle](https://forum.azimuthproject.org/discussion/comment/18654/#Comment_18654) a while ago and it seems relevant for the current discussion on the number of paths in a graph:

> **Puzzle TF4:** We know that we can keep track of *whether it's possible* to get from one vertex to another using a \\(\mathbf{Bool}\\)-enriched category; we can also keep track of *how many steps it takes* using a \\(\mathbf{Cost}\\)-enriched category. Can we also keep track of *how many paths there are* using an enriched category? In which monoidal poset would we have to enrich? And can we do this in such a way that we count paths of length \\(n\\) separately for each \\(n\\)?

I _think_ the answer to the first part of the puzzle is the monoidal poset \\(\mathcal{N}\ := \left\(\mathbb{N} \cup \\{\infty\\}, \le, 1, \cdot\right\)\\).

The \\(\mathcal{N}\\)-enriched category \\(\mathcal{X}\\) has objects the nodes of the graph and the hom-object maps two nodes to the total number of paths between them.

The two properties of the \\(\mathcal{N}\\)-enriched category are:

- \\(1 \le \mathcal{X}(x, x)\\), which says there is at least one path between a node and itself (the zero-length path).

- \\(\mathcal{X}(x, y) \cdot \mathcal{X}(y, z) \le \mathcal{X}(x, z)\\), which sets a lower bound on the number of paths between two nodes based on intermediate paths.

Does anyone know how to solve the second part of the puzzle, that is, how to change the monoidal poset to count paths of length \\(n\\) separately for each \\(n\\)?

> **Puzzle TF4:** We know that we can keep track of *whether it's possible* to get from one vertex to another using a \\(\mathbf{Bool}\\)-enriched category; we can also keep track of *how many steps it takes* using a \\(\mathbf{Cost}\\)-enriched category. Can we also keep track of *how many paths there are* using an enriched category? In which monoidal poset would we have to enrich? And can we do this in such a way that we count paths of length \\(n\\) separately for each \\(n\\)?

I _think_ the answer to the first part of the puzzle is the monoidal poset \\(\mathcal{N}\ := \left\(\mathbb{N} \cup \\{\infty\\}, \le, 1, \cdot\right\)\\).

The \\(\mathcal{N}\\)-enriched category \\(\mathcal{X}\\) has objects the nodes of the graph and the hom-object maps two nodes to the total number of paths between them.

The two properties of the \\(\mathcal{N}\\)-enriched category are:

- \\(1 \le \mathcal{X}(x, x)\\), which says there is at least one path between a node and itself (the zero-length path).

- \\(\mathcal{X}(x, y) \cdot \mathcal{X}(y, z) \le \mathcal{X}(x, z)\\), which sets a lower bound on the number of paths between two nodes based on intermediate paths.

Does anyone know how to solve the second part of the puzzle, that is, how to change the monoidal poset to count paths of length \\(n\\) separately for each \\(n\\)?