Number of paths between 2 vertices in a directed graph

Revision en1, by IDorando, 2022-08-09 13:20:48

Hi Codeforces! There is a problem where it asks you to find the the number of paths between 2 vertices in a directed graph. There are no cycles and you are not allowed to visit the same node multiple times. I have seen some solutions in O(n!) and O(n ^ 2) but I need something more efficient since the number of nodes N is 100000 and the number of edges is 300000. I would really appreciate if you could give me some ideas!

Tags question, number of ways, directed graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English IDorando 2022-08-09 13:20:48 480 Initial revision (published)