finding the paths with successor values

if
sucessor
1 2
2 3,4
3 4
4
if 1,2,3,4 are the activites and beside values are their sucssors for each activity, then how to get the paths for it.
for suppose the above proeblem has the paths
1-2-3-4
1-2-4
these are the two paths we get
is there any code to get paths like that.

1 件のコメント

darova
darova 2019 年 10 月 31 日
I don't understand. Can you make a simple drawing or scheme?

サインインしてコメントする。

回答 (1 件)

Shivam Prasad
Shivam Prasad 2019 年 11 月 4 日
編集済み: Shivam Prasad 2019 年 11 月 4 日

0 投票

Hi Sampath,
This can be solved by performing a depth first search on the array.
Firstly represent the activities and successors as a graph. Here, activities are the nodes and successors are the links to other nodes. Then, perform a depth first search as given in the following link:-

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2019 年 10 月 31 日

編集済み:

2019 年 11 月 4 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by