Finding the number of paths of given length in a undirected unweighted graph

后端 未结 3 546
醉梦人生
醉梦人生 2020-12-24 00:35

\'Length\' of a path is the number of edges in the path.

Given a source and a destination vertex, I want to find the number of paths form the s

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-24 01:13

    Actually the [i][j] entry of A^k shows the total different "walk", not "path", in each simple graph. We can easily prove it by "mathematical induction". However, the major question is to find total different "path" in a given graph. We there are a quite bit of different algorithm to solve, but the upper band is as follow:

    (n-2)(n-3)...(n-k) which "k" is the given parameter stating length of path.

提交回复
热议问题