# Matrix of downstream nodes using LightGraphs

**URL:** <https://discourse.julialang.org/t/matrix-of-downstream-nodes-using-lightgraphs/60314>\
**Category:** Graphs\
**Tags:** package, lightgraphs\
**Created:** [April 30, 2021, 1:55pm UTC](https://discourse.julialang.org/t/matrix-of-downstream-nodes-using-lightgraphs/60314 "2021-04-30T13:55:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cappuccio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cappuccio/32/24603_2.png) [@Cappuccio](https://discourse.julialang.org/u/Cappuccio)\
**Post date:** [April 30, 2021, 1:55pm UTC](https://discourse.julialang.org/t/matrix-of-downstream-nodes-using-lightgraphs/60314/1 "2021-04-30T13:55:14Z")

</div>

![network](https://global.discourse-cdn.com/julialang/original/3X/4/2/42d4a89b2ec4d5a9d59657aeba51727fa4476bb7.png)

Does anyone have an idea as to how you would create a vector of ‘downstream nodes’ for a given node in a network, using LightGraphs? For example, see the network attached, all downstream nodes of 17 would be [19, 20, 21, 22, 23, 24]. The full topology of the network is as follows:

(l, i, j)  
(1, 1, 2)  
(2, 2, 3)  
(3, 3, 4)  
(4, 4, 5)  
(5, 4, 6)  
(6, 6, 7)  
(7, 6, 8)  
(8, 8, 9)  
(9, 8, 10)  
(10, 10, 11)  
(11, 11, 12)  
(12, 12, 13)  
(13, 11, 14)  
(14, 10, 15)  
(15, 15, 16)  
(16, 16, 17)  
(17, 17, 18)  
(18, 17, 19)  
(19, 19, 20)  
(20, 19, 21)  
(21, 19, 22)  
(22, 22, 23)  
(23, 22, 24)  
(24, 16, 25)  
(25, 25, 26)  
(26, 15, 27)  
(27, 27, 28)

Where l is the branch number, i is the ‘from node’ and j is the ‘to node’ of that branch.
