Details
ResourceFunction["ToDirectedAcyclicGraph"] enables not only finding shortest paths, but also counting how many such paths exist.
ResourceFunction["ToDirectedAcyclicGraph"] takes the same options as
Graph, with the additional option "ConflictedEdges" that specifies how to handle conflicted edges.
At time t=0 the algorithm starts to expand directed edges from an initial vertex or set of vertices.
Per increment of time t, more vertices and edges are recursively added on a growing front.
Eventually, this growth process assigns a turn-on time t to each vertex, which is also its graph distance either to vertex or to one or more of the vertices.
An edge is considered to be conflicted at time t if it goes between two vertices with the same turn-on time t.
With
"ConflictedEdges"→False,
ResourceFunction["ToDirectedAcyclicGraph"] deletes conflicted edges.
With
"ConflictedEdges"→True,
ResourceFunction["ToDirectedAcyclicGraph"] returns conflicted edges as undirected edges.